Skip to content

Commit

Permalink
GH-223: release 1.1.17-alpha.1 (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 authored Aug 29, 2019
1 parent 105af3a commit 1e529c0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Install dependencies and download default model

.. code-block:: bash
$ pip install git+https://github.com/facebookresearch/fastText.gitv0.2.0
$ pip install git+https://github.com/facebookresearch/fastText.git@v0.2.0
$ pip install unidecode
$ underthesea download tc_general
$ underthesea download tc_bank
Expand Down Expand Up @@ -237,7 +237,7 @@ Install dependencies

.. code-block:: bash
$ pip install git+https://github.com/facebookresearch/fastText.gitv0.2.0
$ pip install git+https://github.com/facebookresearch/fastText.git@v0.2.0
$ pip install unidecode
$ underthesea download sa_general
$ underthesea download sa_bank
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ commands =
python -m unittest discover tests.classification

; sentiment module
underthesea download sa_general
underthesea download sa_bank
python -m unittest discover tests.sentiment

Expand Down
2 changes: 1 addition & 1 deletion underthesea/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.17-alpha
1.1.17-alpha.1
5 changes: 2 additions & 3 deletions underthesea/sentiment/bank/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import logging
import os
from os.path import dirname
import sys
from languageflow.data import Sentence
from languageflow.models.text_classifier import TextClassifier
from underthesea.model_fetcher import ModelFetcher, UTSModel

from . import text_features

FORMAT = '%(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger('underthesea')

sys.path.insert(0, dirname(__file__))
sys.modules['text_features'] = text_features
model_path = ModelFetcher.get_model_path(UTSModel.sa_bank)
classifier = None

Expand Down
6 changes: 2 additions & 4 deletions underthesea/sentiment/general/__init__.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import logging
import os
from os.path import dirname
import sys
from languageflow.data import Sentence
from languageflow.models.text_classifier import TextClassifier
from underthesea.model_fetcher import ModelFetcher, UTSModel

from . import text_features

FORMAT = '%(message)s'
logging.basicConfig(format=FORMAT)
logger = logging.getLogger('underthesea')

sys.path.insert(0, (dirname(__file__)))
sys.modules['text_features'] = text_features
model_path = ModelFetcher.get_model_path(UTSModel.sa_general)
classifier = None


def sentiment(text):
global classifier

if not classifier:
if os.path.exists(model_path):
classifier = TextClassifier.load(model_path)
Expand Down

0 comments on commit 1e529c0

Please sign in to comment.