diff --git a/examples/images/price-patterns.png b/examples/images/price-patterns.png index fc11c65..665da34 100644 Binary files a/examples/images/price-patterns.png and b/examples/images/price-patterns.png differ diff --git a/examples/images/slack-patterns.png b/examples/images/slack-patterns.png index 3668f69..8e06166 100644 Binary files a/examples/images/slack-patterns.png and b/examples/images/slack-patterns.png differ diff --git a/examples/pattens.ipynb b/examples/pattens.ipynb index 4718451..620bc95 100755 --- a/examples/pattens.ipynb +++ b/examples/pattens.ipynb @@ -2,23 +2,31 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "pycharm": { "name": "#%%\n" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The autoreload extension is already loaded. To reload it, use:\n", + " %reload_ext autoreload\n" + ] + } + ], "source": [ "%load_ext autoreload\n", "%autoreload 2\n", - "import numpy as np\n", "import aspect_based_sentiment_analysis as absa" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 4, "metadata": { "pycharm": { "name": "#%%\n" @@ -27,7 +35,7 @@ "outputs": [], "source": [ "recognizer = absa.aux_models.BasicPatternRecognizer()\n", - "nlp = absa.load('absa/classifier-rest-0.1', pattern_recognizer=recognizer)\n", + "nlp = absa.load('absa/classifier-rest-0.2', pattern_recognizer=recognizer)\n", "text = ('We are great fans of Slack, but we wish the subscriptions ' \n", " 'were more accessible to small startups.')\n", "completed_task = nlp(text, aspects=['slack', 'price'])\n", @@ -36,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": { "pycharm": { "name": "#%%\n" @@ -48,13 +56,13 @@ "output_type": "stream", "text": [ "Sentiment.positive for \"slack\"\n", - "Scores (neutral/negative/positive): [0.019 0.035 0.947]\n" + "Scores (neutral/negative/positive): [0.001 0.001 0.997]\n" ] }, { "data": { "text/plain": "", - "text/html": "Importance 1.00 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.94 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.73 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.64 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.61 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
" + "text/html": "Importance 1.00 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.90 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.60 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.41 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.39 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
" }, "metadata": {}, "output_type": "display_data" @@ -67,7 +75,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": { "pycharm": { "name": "#%%\n" @@ -79,13 +87,13 @@ "output_type": "stream", "text": [ "Sentiment.negative for \"price\"\n", - "Scores (neutral/negative/positive): [0.089 0.569 0.342]\n" + "Scores (neutral/negative/positive): [0.012 0.958 0.03 ]\n" ] }, { "data": { "text/plain": "", - "text/html": "Importance 1.00 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.69 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.53 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.42 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.37 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
" + "text/html": "Importance 1.00 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.85 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.49 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.48 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
Importance 0.41 we are great fans of slack , but we wish the subscriptions were more accessible to small startups .
" }, "metadata": {}, "output_type": "display_data" @@ -99,9 +107,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "name": "pycharm-eb456e21", "language": "python", - "name": "python3" + "display_name": "PyCharm (Aspect-Based-Sentiment-Analysis)" }, "language_info": { "codemirror_mode": {