diff --git a/README.rst b/README.rst index fbbeb142..de95c879 100644 --- a/README.rst +++ b/README.rst @@ -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 @@ -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 diff --git a/tests/sentiment/tst_general.py b/tests/sentiment/test_general.py similarity index 100% rename from tests/sentiment/tst_general.py rename to tests/sentiment/test_general.py diff --git a/tox.ini b/tox.ini index 86dbb990..d9ef96a1 100644 --- a/tox.ini +++ b/tox.ini @@ -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 diff --git a/underthesea/VERSION b/underthesea/VERSION index 3d2b076a..94af5028 100644 --- a/underthesea/VERSION +++ b/underthesea/VERSION @@ -1 +1 @@ -1.1.17-alpha +1.1.17-alpha.1 diff --git a/underthesea/sentiment/bank/__init__.py b/underthesea/sentiment/bank/__init__.py index 20accb08..fafb6cc7 100644 --- a/underthesea/sentiment/bank/__init__.py +++ b/underthesea/sentiment/bank/__init__.py @@ -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 diff --git a/underthesea/sentiment/general/__init__.py b/underthesea/sentiment/general/__init__.py index a116fb95..c3063668 100644 --- a/underthesea/sentiment/general/__init__.py +++ b/underthesea/sentiment/general/__init__.py @@ -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)