I'm trying to build a project with SpaCy as a linguist however I'm not good at programming stuff. I tried everything I know but couldn't import spacy. I used pip, I added libraries on settings of Pycharm, I tried everything. How can I solve it?
I would recommend that you read this spacy quickstart for some instructions on Spacy installation and first steps.
In general, the following recipe should work for you:
pip
:pip install spacy
en_core_web_sm
for basic NLP tasks in English language:python -m spacy download en_core_web_sm
import spacy
nlp = spacy.load("en_core_web_sm") # Load model
doc = nlp("This is a sentence.") # Build a doc from a simple string
# Print tokens in doc
for token in doc:
print(token.text, token.pos_, token.dep_)
In case this is your first time working with Spacy, spaCy-101 is an amazing official tutorial that will gradually introduce you to the basic concepts of NLP and how they are implemented in Spacy.
I hope this helps you!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.