我正在尝试使用 Python(SpaCy/Textacy/Textblob)从文本文件中读取内容(博客),但到目前为止它一直是徒劳的。以下是我最近尝试过的代码:
import content as content
import pattern as pattern
import textacy
import spacy
nlp = spacy.load('en')
verb_clause_pattern = r'<VERB><ADV><PART><VERB>+<PART>'
doc = textacy.Doc.content, lang = 'en'
lists = textacy.extract.pos_regex_matches(doc, pattern)
for list in lists:
print(list.text)
我收到以下错误:
"E:\TWP\TWP\venv\Scripts\python.exe E:/TWP/TWP/VerbPhrases.py
Traceback (most recent call last):
File "E:/TWP/TWP/VerbPhrases.py", line 5, in <module>
nlp = spacy.load('en')
File "E:\TWP\TWP\venv\lib\site-packages\spacy\__init__.py", line 30, in load
return util.load_model(name, **overrides)
File "E:\TWP\TWP\venv\lib\site-packages\spacy\util.py", line 169, in load_model
raise IOError(Errors.E050.format(name=name))
OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory."