Registry / ai-ml / recognizers-text

recognizers-text

JSON →
library1.0.2a2pypypiunverified

Recognizers-Text is a Microsoft-maintained NLP library for recognizing and normalizing numbers, units, date/time, phone numbers, emails, and URLs from unstructured text. It supports multiple languages (English, Spanish, French, Chinese, Japanese, and more) via separate per-culture packages. The Python package is at version 1.0.2a2 (alpha) and lags behind the .NET and JavaScript releases (v1.8.x). Releases are irregular.

pip install recognizers-text
INSTALL
IMPORT
SIG · RECOGNIZERS-TEXT
R
recognizers-text
ai-mlpythonv1.0.2a2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Culture
from recognizers_text import Culture
from recognizers_text import Culture

Recognizes a date from an English sentence and prints the recognition result.

from recognizers_text import Culture, recognize_datetime # Recognize dates in English text results = recognize_datetime("I'll be there on 2025-06-15", Culture.English) for result in results: print(f"Text: {result.text}, Type: {result.type_name}, Resolution: {result.resolution}") # Example output: # Text: 2025-06-15, Type: datetimeV2.date, Resolution: {'values': [{'timex': '2025-06-15', 'type': 'date', 'value': '2025-06-15'}]}
Debug
Known issues
gotchaThe Python package (1.0.2a2) is an alpha release and significantly outdated compared to the .NET/JS versions (v1.8.x). Many languages and features (e.g., phone numbers, URLs) are missing.
fix
If you need the latest recognizers, use the .NET or JavaScript libraries instead.
affects: >=0.0.0
gotchaAll recognizer functions are in the same 'recognizers_text' top-level module. Do not import from sub-packages like 'recognizers_number' or 'recognizers_datetime' — they are not directly importable.
fix
Use 'from recognizers_text import recognize_number, recognize_datetime, ...'.
affects: >=0.0.0
gotchaCulture is a class, not an enum or string. You must use Culture.English, Culture.Spanish, etc. Passing a string like 'en-us' will raise an AttributeError.
fix
Always use Culture attributes. Example: Culture.English.
affects: >=0.0.0
deprecatedThe 'recognizers_text' package does not include the optional 'datatypes-timex-expression' dependency by default. Without it, accessing 'result.resolution' as a Timex object will fail.
fix
Install with extra: pip install recognizers-text[datatypes-timex-expression]
affects: >=0.0.0
gotchaRecognition results may return empty lists for unrecognized text; they do not raise exceptions. Always check the result length.
fix
if not results: # handle no match
affects: >=0.0.0
gotchaThe 'recognizers_text' package name is slightly different from the GitHub repo name 'Recognizers-Text' (capitalized with hyphen). Import uses underscores.
fix
Use 'import recognizers_text' (all lowercase, underscore).
affects: >=0.0.0
Upgrade
Version history
1.0.2a2latest on PyPI · released Nov 12, 2019
Audit
Dependencies
recognizers-text-datatypes-timex-expressionoptionalRequired for working with Timex properties and date/time resolution.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources