Skip to content

Instantly share code, notes, and snippets.

@abhishek-shrm
Created July 24, 2020 10:01
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 abhishek-shrm/0950074183c8874d0dfcd79c9469b9e1 to your computer and use it in GitHub Desktop.
Save abhishek-shrm/0950074183c8874d0dfcd79c9469b9e1 to your computer and use it in GitHub Desktop.
import spacy
nlp=spacy.load('en_core_web_sm')
text='It took me more than two hours to translate a few pages of English.'
for token in nlp(text):
print(token.text,'=>',token.dep_,'=>',token.head.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment