Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created December 1, 2020 17:13
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 amankharwal/217b65a86e2e6438f33f4e0cf2829648 to your computer and use it in GitHub Desktop.
Save amankharwal/217b65a86e2e6438f33f4e0cf2829648 to your computer and use it in GitHub Desktop.
text_doc = nlp("Glowing review overall, and some really interesting side-by-side "
"photography tests pitting the iPhone 11 Pro against the "
"Galaxy Note 10 Plus and last year’s iPhone XS and Google Pixel 3.")
matches = matcher(text_doc)
match_id, start, end = matches[0]
print(nlp.vocab.strings[match_id], text_doc[start:end])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment