No module named 'en_core_web_sm'

Viewed 1310

I am trying to use the en_core_web_sm in Jupyter Notebook.

I have tried to use: conda install en_core_web_sm but It did not work how can I install this ?

2 Answers

en_core_web_sm is a language model provided by SpaCy. First, you have to install SpaCy, then try this snippet:

import spacy
from spacy.lang.en.examples import sentences 

nlp = spacy.load("en_core_web_sm")
doc = nlp(sentences[0])
print(doc.text)
for token in doc:
    print(token.text, token.pos_, token.dep_)

!python -m spacy download en_core_web_sm Please try this and hope it works

Related