我是 NLP 和 spaCy 的新手。在this site,我正在尝试学习spaCy。我完成了模型的安装(en_core_web_en)。我在此目录中设置了spaCy:' / home / uapncpc / myProjects / project02 / spaCy /'。
在这个目录中,我创建了test.py文件,内容如下:
import spacy
nlp = spacy.load('en')
doc = nlp(u'This is a sentence.')
当我运行此代码时,我收到以下错误:
Traceback (most recent call last):
File "/home/uapncpc/myProjects/project02/spaCy/test.py", line 2, in <module>
nlp = spacy.load('en')
File "/home/uapncpc/myProjects/project02/spaCy/spacy/__init__.py", line 42, in load
return cls(**overrides)
File "/home/uapncpc/myProjects/project02/spaCy/spacy/en/__init__.py", line 34, in __init__
Language.__init__(self, **overrides)
File "/home/uapncpc/myProjects/project02/spaCy/spacy/language.py", line 279, in __init__
if 'parser' not in overrides \
File "/home/uapncpc/myProjects/project02/spaCy/spacy/language.py", line 100, in create_parser
return DependencyParser.load(nlp.path / 'deps', nlp.vocab, **cfg)
File "spacy/syntax/parser.pyx", line 158, in spacy.syntax.parser.Parser.load (spacy/syntax/parser.cpp:7659)
self.model.load(str(path / 'model'))
File "thinc/linear/avgtron.pyx", line 104, in thinc.linear.avgtron.AveragedPerceptron.load (thinc/linear/avgtron.cpp:3514)
File "preshed/maps.pyx", line 34, in preshed.maps.PreshMap.__init__ (preshed/maps.cpp:1193)
File "preshed/maps.pyx", line 109, in preshed.maps.map_init (preshed/maps.cpp:3058)
File "cymem/cymem.pyx", line 42, in cymem.cymem.Pool.alloc (cymem/cymem.cpp:1091)
MemoryError: Error assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytesError assigning 33554432 bytes
我正在使用:
现在我需要帮助
提前致谢