This release is a pre-release and may not be stable for production use.
simple_NER
Lightweight named-entity recognition library with pluggable annotators, multi-language support, and an async pipeline.
Installation
pip install simple_NER
pip install "simple_NER[dev]" # + testing tools
Quick Start
from simple_NER import create_pipeline
pipe = create_pipeline(["email", "phone", "url", "temporal", "currency"])
for entity in pipe.process("Call +1-800-555-0100 or email info@example.com by 2025-06-01"):
print(entity.entity_type, entity.value, entity.confidence)
# phone +1-800-555-0100 0.9
# email info@example.com 1.0
# date 2025-06-01 0.85
Annotators
| Factory key(s) | Class | Detects | Language |
|---|---|---|---|
email, email_regex |
EmailAnnotator / EmailNER | Email addresses | Any |
names |
NamesNER | Person names (noun heuristic, confidence 0.65-0.8) | English / Latin |
locations, countries, cities |
LocationNER | Countries, capitals, cities | All (wordlist) |
temporal, datetime, duration |
TemporalNER | Dates, times, durations | lang param |
numbers, written_numbers |
NumberNER | Numeric and written numbers | lang param |
| Factory key(s) | Class | Detects | Language |
|---|---|---|---|
lookup, wordlist |
LookUpNER | Custom wordlists | lang param |
url, urls |
URLAnnotator | HTTP/HTTPS URLs | Any |
phone, phone_number |
PhoneAnnotator | Phone numbers | Any |
currency, money |
CurrencyAnnotator | Amounts + currency symbol/code | Any |
organization, org, company |
OrganizationAnnotator | Org/company names | lang param |
| Factory key(s) | Class | Detects | Language |
|---|---|---|---|
hashtag, hashtags, tag |
HashtagAnnotator | #hashtags | Any |
date, dates |
DateAnnotator | Structured date strings | lang param |
Key annotator parameters
LocationNER: include_countries=True, include_capitals=True, include_cities=False,
label_confidence={"City": 0.7, "Country": 0.95}
PhoneAnnotator: require_country_code=False, min_length=7
OrganizationAnnotator: strict_mode=False (when True, requires corporate suffix like Inc./GmbH)
TemporalNER / NumberNER / DateAnnotator / LookUpNER: lang="en-us", optionally anchor_date for TemporalNER
Entity Data Fields
Each Entity carries a data dict with annotator-specific fields:
| Annotator | Extra fields in data |
|---|---|
| EmailAnnotator | local_part, domain, start, end |
| URLAnnotator | protocol, start, end |
| PhoneAnnotator | digits, digit_count, type (international/us_national/local/other), has_country_code, start, end |
| CurrencyAnnotator | amount (float), currency (ISO code), currency_symbol, start, end |
| LocationNER | country_code, label, start, end |
| Annotator | Extra fields in data |
|---|---|
| HashtagAnnotator | tag_type (shouting/lowercase/CamelCase/underscored/alphanumeric/mixed), start, end |
| OrganizationAnnotator | org_type (company/educational/medical/other), start, end |
| NumberNER | number (str, digit form), start, end |
| DateAnnotator | year, month, day, format, start, end |
Pipeline Dedup Strategies
NERPipeline and AsyncNERPipeline accept a dedup_strategy argument:
| Strategy | Behaviour |
|---|---|
keep_all |
Return every entity span, including overlaps |
keep_longest |
When spans overlap, keep the longer one |
keep_higher_confidence |
When spans overlap, keep the higher-confidence one |
keep_first |
When spans overlap, keep the first one encountered |
pipe = create_pipeline(["currency", "numbers"], dedup_strategy="keep_longest")
Locale / i18n System
Annotators load language-specific patterns from simple_NER/locale/<lang>/:
| Extension | Content | Loader |
|---|---|---|
.rx |
One raw regex per line | load_rx(name, lang) |
.intent |
NL templates {var} → named capture |
load_intents(name, lang) |
.txt |
Plain wordlist, one entry per line | load_wordlist(name, lang) |
All loaders fall back to en-us when no language-specific file exists.
intent_to_regex("{amount} dollars") converts an intent template to a compiled re.Pattern.
Adding a new language: create simple_NER/locale/<lang>/ and place .rx, .intent, or .txt files
that override the en-us defaults. Only the files you add are used. Everything else falls back automatically.
Inside a BaseAnnotator subclass, self._load_rx("name") and self._load_intents("name") resolve
to self.lang automatically.
Existing locale data: en-us (phone, email, url, hashtag, currency, organization, date_months),
de-de (currency, organization, date_months), es/fr/it/nl/pt (date_months).
Async Batch Processing
import asyncio
from simple_NER.annotators.async_pipeline import AsyncNERPipeline
pipe = AsyncNERPipeline(dedup_strategy="keep_longest")
pipe.add_annotator(...)
async def run():
results = await pipe.process_batch_async(sentences, max_concurrency=10)
asyncio.run(run())
OVOS Plugin
simple_NER ships an intent-transformer plugin for the OpenVoiceOS / OVOS ecosystem.
Entry-point group: opm.transformer.intent, key: simple-ner-transformer, priority 50,
class: SimpleNERIntentTransformer.
{
"intent_transformers": {
"simple-ner-transformer": {
"annotators": ["email", "phone", "temporal", "currency"],
"confidence_threshold": 0.6,
"lang": "en-us"
}
}
}
The transformer runs the configured pipeline on every utterance and injects recognized entities
into match_data before intent handling proceeds.
Documentation
New to simple_NER? Start here:
- Getting Started: installation, first pipeline, common patterns
- FAQ & Troubleshooting: answers to common questions
Need details?
- API Reference: class and method documentation
- Complete Architecture: design, all annotators, advanced topics
- Tutorials: step-by-step guides for specific use cases
Learn by example:
- examples/README.md: 15+ runnable scripts (quick start, all annotators, async, custom types, OVOS plugin, etc.)
Project info:
- GitHub: source code, issues, discussions
- CHANGELOG.md: version history
- AUDIT.md: known issues and technical debt
Metadata
Release files for simple-NER 0.9.2a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple_ner-0.9.2a1.tar.gz | 2.2 MB | Without provenance | Details for simple_ner-0.9.2a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_ner-0.9.2a1-py3-none-any.whl | Python 3 | none | any | Details for simple_ner-0.9.2a1-py3-none-any.whl |
Total release size: 4.4 MB
Release files / simple_ner-0.9.2a1.tar.gz
| Download URL | simple_ner-0.9.2a1.tar.gz |
|---|---|
| Size | 2.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5e7b9041a88ad82b9bff28c8a104a4fa1b5f97367362363ceab98416b409b19
|
|
BLAKE2b-256 checksum How to use checksums |
ac8d86268b0b2b32ae8bad3f33d7e88dbbdefd9c70ce9192dd91f6f4d66b6b2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / simple_ner-0.9.2a1-py3-none-any.whl
| Download URL | simple_ner-0.9.2a1-py3-none-any.whl |
|---|---|
| Size | 2.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c9d2bfdc709873ccca0c84f195d17255dc16a2ce9c7ebcd19bf0cd6fbba46e7
|
|
BLAKE2b-256 checksum How to use checksums |
841bcc278211acc07f70bdd1e3bd7556cd507868729c7d95dd234b6f313126b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for simple-NER 0.9.2a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.