Skip to content

Instantly share code, notes, and snippets.

@abhishek-shrm
Created July 24, 2020 10:08
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/2a80b29ce3e591df149422250847252f to your computer and use it in GitHub Desktop.
Save abhishek-shrm/2a80b29ce3e591df149422250847252f to your computer and use it in GitHub Desktop.
from benepar.spacy_plugin import BeneparComponent
# Loading spaCy’s en model and adding benepar model to its pipeline
nlp = spacy.load('en')
nlp.add_pipe(BeneparComponent('benepar_en2'))
text='It took me more than two hours to translate a few pages of English.'
# Generating a parse tree for the text
list(nlp(text).sents)[0]._.parse_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment