遇到错误让Spacy加载模型

时间:2017-09-01 04:50:48

标签: amazon-web-services nlp elastic-beanstalk spacy

我在Django部署了一个Elastic Beanstalk网络应用,我正在尝试实施spacy,但遇到错误。

我在en_core_web_sm requirements.txt中列出了https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-1.2.0/en_core_web_sm-1.2.0.tar.gz的下载链接import en_core_web_sm

我在我的代码中导入了我的调用nlp = en_core_web_sm.load(),之后尝试将其加载:

eb

然而,在2gb的日志中,我收到错误,表明模型未正确加载。我在这里错过了什么吗?我的实例配置为[Fri Sep 01 04:33:49.276836 2017] [:error] [pid 23201] \x1b[93m Warning: no model found for 'en'\x1b[0m [Fri Sep 01 04:33:49.276841 2017] [:error] [pid 23201] [Fri Sep 01 04:33:49.276849 2017] [:error] [pid 23201] [Fri Sep 01 04:33:49.276851 2017] [:error] [pid 23201] Only loading the 'en' tokenizer. [Fri Sep 01 04:33:49.276855 2017] [:error] [pid 23201] [Fri Sep 01 04:33:49.333165 2017] [:error] [pid 23201] Internal Server Error: /webhookmb/ [Fri Sep 01 04:33:49.333187 2017] [:error] [pid 23201] Traceback (most recent call last): [Fri Sep 01 04:33:49.333189 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/core/handlers/exception.py", line 41, in inner [Fri Sep 01 04:33:49.333192 2017] [:error] [pid 23201] response = get_response(request) [Fri Sep 01 04:33:49.333194 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response [Fri Sep 01 04:33:49.333196 2017] [:error] [pid 23201] response = self.process_exception_by_middleware(e, request) [Fri Sep 01 04:33:49.333198 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response [Fri Sep 01 04:33:49.333201 2017] [:error] [pid 23201] response = wrapped_callback(request, *callback_args, **callback_kwargs) [Fri Sep 01 04:33:49.333203 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view [Fri Sep 01 04:33:49.333205 2017] [:error] [pid 23201] return view_func(*args, **kwargs) [Fri Sep 01 04:33:49.333216 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/views/decorators/http.py", line 40, in inner [Fri Sep 01 04:33:49.333218 2017] [:error] [pid 23201] return func(request, *args, **kwargs) [Fri Sep 01 04:33:49.333220 2017] [:error] [pid 23201] File "/opt/python/current/app/webhookmb/views.py", line 81, in webhookmb [Fri Sep 01 04:33:49.333222 2017] [:error] [pid 23201] interpreter = Interpreter.load(metadata, RasaNLUConfig("rasa_nlu/config_spacy.json")) [Fri Sep 01 04:33:49.333224 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/model.py", line 213, in load [Fri Sep 01 04:33:49.333226 2017] [:error] [pid 23201] component_name, model_metadata.model_dir, model_metadata, **context) [Fri Sep 01 04:33:49.333228 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/components.py", line 310, in load_component [Fri Sep 01 04:33:49.333229 2017] [:error] [pid 23201] model_metadata, cached_component, **context) [Fri Sep 01 04:33:49.333231 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/registry.py", line 128, in load_component_by_name [Fri Sep 01 04:33:49.333233 2017] [:error] [pid 23201] return component_clz.load(model_dir, metadata, cached_component, **kwargs) [Fri Sep 01 04:33:49.333235 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/utils/spacy_utils.py", line 99, in load [Fri Sep 01 04:33:49.333237 2017] [:error] [pid 23201] cls.ensure_proper_language_model(nlp) [Fri Sep 01 04:33:49.333239 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/utils/spacy_utils.py", line 113, in ensure_proper_language_model [Fri Sep 01 04:33:49.333240 2017] [:error] [pid 23201] "Make sure you have downloaded the correct model (https://spacy.io/docs/usage/).") [Fri Sep 01 04:33:49.333244 2017] [:error] [pid 23201] Exception: Failed to load spacy language model for lang 'en'. Make sure you have downloaded the correct model (https://spacy.io/docs/usage/). 的RAM,这可能还不够,但它不应该影响模型的加载,对吧?为什么要加载标记器而不加载模型?

F1.txt 

1   549 15981
2   835 19591
3   322 3896
4   298 3778

F2.txt 

1   549 15981
2   835 19591
3   322 3896
4   298 3778
5   16  202

0 个答案:

没有答案