Merge pull request #16 from rahul3/NLPCRAFT-388

Nlpcraft 388
diff --git a/nlpcraft/src/main/python/ctxword/bin/install_dependencies.sh b/nlpcraft/src/main/python/ctxword/bin/install_dependencies.sh
index 30c1a3b..12b9122 100755
--- a/nlpcraft/src/main/python/ctxword/bin/install_dependencies.sh
+++ b/nlpcraft/src/main/python/ctxword/bin/install_dependencies.sh
@@ -38,9 +38,4 @@
 
 [ ! -f data/cc.en.300.bin ] && { gunzip -v data/cc.en.300.bin.gz || abort "Failed to extract files."; }
 
-[ ! -d /tmp/fastText/ ] && git clone https://github.com/facebookresearch/fastText.git /tmp/fastText
-
-pip3 install /tmp/fastText || abort "Failed to install fasttext python module."
-pip3 install -r bin/py_requirements || abort "Failed to install pip3 requirements from 'bin/py_requirements'."
-
-rm -rf /tmp/fastText
+pip3 install -r bin/py_requirements || abort "Failed to install pip3 requirements from 'bin/py_requirements'."
\ No newline at end of file
diff --git a/nlpcraft/src/main/python/ctxword/bin/py_requirements b/nlpcraft/src/main/python/ctxword/bin/py_requirements
index bb0c20d..1e39f0f 100644
--- a/nlpcraft/src/main/python/ctxword/bin/py_requirements
+++ b/nlpcraft/src/main/python/ctxword/bin/py_requirements
@@ -16,6 +16,54 @@
 #
 
 # Dependency list for 'ctxword' Python module.
-flask==1.1.2
-transformers==2.7.0
+aniso8601==9.0.1
+blis==0.7.4
+boto3==1.18.11
+botocore==1.21.11
+catalogue==2.0.4
+certifi==2021.5.30
+charset-normalizer==2.0.4
+click==7.1.2
+cymem==2.0.5
+en-core-web-sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.1.0/en_core_web_sm-3.1.0-py3-none-any.whl
+fasttext==0.9.2
+filelock==3.0.12
+Flask==1.1.2
+Flask-RESTful==0.3.9
+future==0.18.2
+idna==3.2
+itsdangerous==2.0.1
+Jinja2==3.0.1
+jmespath==0.10.0
+joblib==1.0.1
+MarkupSafe==2.0.1
+murmurhash==1.0.5
+numpy==1.21.1
+packaging==21.0
+pathy==0.6.0
+preshed==3.0.5
+pybind11==2.7.0
+pydantic==1.8.2
+pyparsing==2.4.7
+python-dateutil==2.8.2
+pytz==2021.1
+regex==2021.7.6
+requests==2.26.0
+s3transfer==0.5.0
+sacremoses==0.0.45
+sentencepiece==0.1.96
+six==1.16.0
+smart-open==5.1.0
+spacy==3.1.1
+spacy-legacy==3.0.8
+srsly==2.4.1
+thinc==8.0.8
+tokenizers==0.5.2
 torch==1.6.0
+tqdm==4.62.0
+transformers==2.7.0
+typer==0.3.2
+typing-extensions==3.10.0.0
+urllib3==1.26.6
+wasabi==0.8.2
+Werkzeug==2.0.1
diff --git a/nlpcraft/src/main/python/spacy_proxy.py b/nlpcraft/src/main/python/spacy_proxy.py
index 4a39964..b71b477 100644
--- a/nlpcraft/src/main/python/spacy_proxy.py
+++ b/nlpcraft/src/main/python/spacy_proxy.py
@@ -21,6 +21,9 @@
 from flask import Flask, request
 from flask_restful import Resource, Api
 
+import logging
+
+logger = logging.getLogger(__name__)
 #
 # This is an example of spaCy REST proxy. It only should be used during development.
 # For production usage we recommend WSGI server instead.
@@ -30,7 +33,12 @@
 # Add your own or modify spaCy libraries here.
 # By default, the English model 'en_core_web_sm' is loaded.
 #
-nlp = spacy.load("en_core_web_sm")
+spacy_model_name = "en_core_web_sm"
+try:
+    nlp = spacy.load(spacy_model_name)
+except Exception as err:
+    logger.error(f"Error loading spaCy model: {spacy_model_name}")
+    logger.error(err)
 
 app = Flask(__name__)
 api = Api(app)