I am trying to read the contents (blog) from a text file using Python (SpaCy/Textacy/Textblob) but it has been in vain, so far. Following is the code that I have recently tried:
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)
And I am getting following error:
"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."