Skip to content

Instantly share code, notes, and snippets.

@ahmedbesbes
Created August 20, 2022 20:30
Show Gist options
  • Save ahmedbesbes/ce4814cce50737f292381e235547c435 to your computer and use it in GitHub Desktop.
Save ahmedbesbes/ce4814cce50737f292381e235547c435 to your computer and use it in GitHub Desktop.
import spacy
from spacy import displacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("John lives in France and works at Apple Inc.")
print(doc.ents)
# (John, France, Apple Inc.)
displacy.render(doc, style="ent")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment