Last active
November 30, 2020 01:59
-
-
Save chiefastro/6736a3f052d6725f0e98d25e1664f381 to your computer and use it in GitHub Desktop.
Linguistics in one line of code with spaCy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
# make sure to download the model first | |
# use either the CLI or this line of code | |
spacy.cli.download('en_core_web_sm') | |
# load pre-trained model pipeline | |
nlp = spacy.load('en_core_web_sm') | |
# text document | |
text = 'spaCy is pretty cool.' | |
# apply pipeline | |
doc = nlp(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment