Skip to content

Instantly share code, notes, and snippets.

@SKaplanOfficial
Last active January 18, 2023 21:58
Show Gist options
  • Save SKaplanOfficial/6a87529a5f2e2d3c4dc30f6a3e493bc7 to your computer and use it in GitHub Desktop.
Save SKaplanOfficial/6a87529a5f2e2d3c4dc30f6a3e493bc7 to your computer and use it in GitHub Desktop.
Named entity tagging with PyXA
import PyXA # Version 0.2.0
text = PyXA.XAText("Tim Cook is the CEO of Apple.")
print(text.tag_entities())
# [('Tim', 'PersonalName'), ('Cook', 'PersonalName'), ('is', 'Verb'), ('the', 'Determiner'), ('CEO', 'Noun'), ('of', 'Preposition'), ('Apple', 'OrganizationName')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment