Skip to content

Instantly share code, notes, and snippets.

@James-McNeill
Created July 16, 2021 07:48
Show Gist options
  • Save James-McNeill/6ceade281488181bb58b4e9e731bac00 to your computer and use it in GitHub Desktop.
Save James-McNeill/6ceade281488181bb58b4e9e731bac00 to your computer and use it in GitHub Desktop.
# Extract insights from the excerpt variable using spacy
import spacy
# Initialise spacy with english as the language
nlp = spacy.load('en_core_web_sm')
# Perform initial test on the first excerpt
sample1 = train.loc[0, 'excerpt']
# Create the spacy doc item for review
doc = nlp(sample1)
doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment