Skip to content

Instantly share code, notes, and snippets.

@chiefastro
Last active November 30, 2020 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiefastro/6736a3f052d6725f0e98d25e1664f381 to your computer and use it in GitHub Desktop.
Save chiefastro/6736a3f052d6725f0e98d25e1664f381 to your computer and use it in GitHub Desktop.
Linguistics in one line of code with spaCy
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