Python named entity recognition libraries

Updated Nov 2026

Python named entity recognition libraries find the names of people, organizations, places, and other entities in text and label each one. A model returns each entity with its label and its character position in the original text. These libraries let search systems, compliance tools, and AI agents pull structured facts out of documents.

Popularity

Transformers has the most monthly downloads in this comparison, at 120.5M, a count that covers every model task in the library.

LibraryMonthly downloadsStarsLast releaseLicense
Transformers
120.5M
169.2KNov 2026Apache-2.0
NLTK
48.7M
14.8KOct 2026Apache-2.0
spaCy
25.2M
34.1KOct 2026MIT
Presidio Analyzer
6.3M
12.0KOct 2026MIT
Stanza
997.2K
7.9KNov 2026Apache-2.0
GLiNER
799.3K
4.3KOct 2026Apache-2.0
Spark NLP
790.4K
4.2KNov 2026Apache-2.0
Polyglot
88.3K
2.4KJul 2016GPLv3
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Defines and runs machine learning models for text, vision, audio, and multimodal tasks.

Downloads / mo
120.5M
Stars
169.2K
Last release
5.23.0
License
Apache-2.0
$ pip install "transformers[torch,sentencepiece]"
from transformers import pipeline

ner = pipeline(model="Jean-Baptiste/camembert-ner", aggregation_strategy="simple")
entities = ner("Je m’appelle Jean-Baptiste.")

Transformers examples

From open-source projects on GitHub

Provides the Natural Language Toolkit.

Downloads / mo
48.7M
Stars
14.8K
Last release
3.10.4
License
Apache-2.0

Quickstart

From named_entity.py
$ pip install nltk
import nltk

nltk.download("maxent_ne_chunker_tab")
nltk.download("words")
entities = nltk.ne_chunk([("Ada", "NNP"), ("Lovelace", "NNP")])

NLTK examples

From open-source projects on GitHub

Recognizes labeled entity spans through a configurable NLP pipeline.

Downloads / mo
25.2M
Stars
34.1K
Last release
3.8.18
License
MIT

Strengths

  • Adds rules alongside learned entities. Use EntityRuler patterns to assign entity labels from text rules.
  • Retains character positions. Read start_char and end_char from the returned entity spans.

Limitations

  • Standard NER excludes overlapping entities. Doc.ents entity spans must remain non-overlapping.
$ pip install spacy
import spacy

nlp = spacy.load("en_core_web_sm")
doc = nlp("Ada Lovelace worked in London.")

spaCy examples

From open-source projects on GitHub

Presidio Analyzer

Provides the Presidio Analyzer package.

Downloads / mo
6.3M
Stars
12.0K
Last release
2.2.366
License
MIT

Quickstart

From index.md
$ pip install presidio-analyzer
from presidio_analyzer import AnalyzerEngine

analyzer = AnalyzerEngine()
results = analyzer.analyze(text="Ada Lovelace worked in London.", language="en")

Presidio Analyzer examples

From open-source projects on GitHub

Labels named-entity spans and individual tokens in a language pipeline.

Downloads / mo
997.2K
Stars
7.9K
Last release
1.15.1
License
Apache-2.0

Strengths

  • Returns span and token labels. Read entities from the document or NER tags from individual tokens.
  • Retains outputs from multiple taggers. Configure multiple NER packages and inspect per-token multi_ner labels.

Limitations

  • NER depends on tokenization. Include tokenize when selecting the NER pipeline’s processors.
  • Larger minibatches need more memory. Reduce ner_batch_size when recognition batches exceed available memory.

Quickstart

From ner.html
$ pip install stanza
import stanza

nlp = stanza.Pipeline(lang="en", processors="tokenize,ner")
doc = nlp("Ada Lovelace worked in London.")

Stanza examples

From open-source projects on GitHub

Recognizes entities using labels supplied for the prediction task.

Downloads / mo
799.3K
Stars
4.3K
Last release
0.2.30
License
Apache-2.0

Strengths

  • Accepts labels at prediction time. Pass the desired entity labels to predict_entities.
  • Can fine-tune custom models. Use train_model with training and evaluation data.

Limitations

  • Batch helper is deprecated. Use inference instead of batch_predict_entities for multiple texts.

Quickstart

From README.md
$ pip install gliner
from gliner import GLiNER

model = GLiNER.from_pretrained("gliner-community/gliner_small-v2.5")
entities = model.predict_entities("Ada Lovelace worked in London.", ["person", "city"])

GLiNER examples

From open-source projects on GitHub

Annotates text with NLP models on Apache Spark ML.

Downloads / mo
790.4K
Stars
4.2K
Last release
7.0.1
License
Apache-2.0

Quickstart

From README.md
$ pip install spark-nlp
import sparknlp
from sparknlp.pretrained import PretrainedPipeline

spark = sparknlp.start()
model = PretrainedPipeline("explain_document_dl", lang="en")
result = model.annotate("Ada Lovelace worked in London.")

Runs a natural language pipeline for multilingual applications.

Downloads / mo
88.3K
Stars
2.4K
Last release
16.7.4
License
GPLv3
$ pip install polyglot
from polyglot.text import Text

text = Text("Ada Lovelace worked in London.", hint_language_code="en")
entities = text.entities

FAQ

spaCy suits production pipelines with trained entity recognizers and rule-based matching. GLiNER suits extracting entity types named at inference time. Transformers suits teams that run or fine-tune pretrained token classification models.

Presidio Analyzer finds personal information in text by combining NER models, patterns, and other recognizers. It can call GLiNER as an optional backend.

GLiNER is a generalist NER model that accepts entity labels as input at inference time. The model still determines how well it finds each label.

spaCy runs a trained entity recognizer in its pipeline and stores each result as a span with character offsets. An entity ruler adds matches from patterns.

spaCy returns entities with character offsets from a trainable recognizer. NLTK chunks entities from tokens that the caller has already tagged with parts of speech.

For coding agents

Found your named entity recognition library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official