Skip to content

Instantly share code, notes, and snippets.

@ctufts
Created January 27, 2022 18:34
Show Gist options
  • Save ctufts/47047229991fa0c99c28b23a108c62d2 to your computer and use it in GitHub Desktop.
Save ctufts/47047229991fa0c99c28b23a108c62d2 to your computer and use it in GitHub Desktop.
Spacy Snippets

View entities of a list of docs:

doc = nlp("George Washington was the first president of the United States.")

for ent in doc.ents:
    print("entity: ", ent.text, " : ", ent.label_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment