Skip to content

Instantly share code, notes, and snippets.

@shubham-singh-ss
Last active July 18, 2019 06:09
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 shubham-singh-ss/e2a2e6ae008d5c2ecb828a8f9a8edd59 to your computer and use it in GitHub Desktop.
Save shubham-singh-ss/e2a2e6ae008d5c2ecb828a8f9a8edd59 to your computer and use it in GitHub Desktop.
#make sure to download the english model with "python -m spacy download en"
import en_core_web_sm
nlp = en_core_web_sm.load()
doc = nlp(u"""He determined to drop his litigation with the monastry, and relinguish his claims to the wood-cuting and
fishery rihgts at once. He was the more ready to do this becuase the rights had become much less valuable, and he had
indeed the vaguest idea where the wood and river in question were.""")
lemma_word1 = []
for token in doc:
lemma_word1.append(token.lemma_)
lemma_word1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment