What is @microsoft/recognizers-text?
@microsoft/recognizers-text is a library that provides robust recognition and resolution of text entities such as numbers, dates, times, currencies, and more. It is designed to help developers extract structured information from unstructured text in multiple languages.
What are @microsoft/recognizers-text's main functionalities?
Number Recognition
This feature allows you to recognize and extract numbers from text. The code sample demonstrates how to use the `recognizeNumber` function to identify numbers in a given input string.
const { recognizeNumber } = require('@microsoft/recognizers-text-number');
const input = 'I have two apples and 3 oranges.';
const results = recognizeNumber(input, 'en-us');
console.log(results);
Date and Time Recognition
This feature enables the recognition and extraction of date and time entities from text. The code sample shows how to use the `recognizeDateTime` function to identify date and time information in a given input string.
const { recognizeDateTime } = require('@microsoft/recognizers-text-date-time');
const input = 'Let's meet on July 20th at 3 PM.';
const results = recognizeDateTime(input, 'en-us');
console.log(results);
Currency Recognition
This feature allows for the recognition and extraction of currency values from text. The code sample demonstrates how to use the `recognizeCurrency` function to identify currency amounts in a given input string.
const { recognizeCurrency } = require('@microsoft/recognizers-text-number-with-unit');
const input = 'The total cost is $45.50.';
const results = recognizeCurrency(input, 'en-us');
console.log(results);
Temperature Recognition
This feature enables the recognition and extraction of temperature values from text. The code sample shows how to use the `recognizeTemperature` function to identify temperature information in a given input string.
const { recognizeTemperature } = require('@microsoft/recognizers-text-number-with-unit');
const input = 'The temperature is 30 degrees Celsius.';
const results = recognizeTemperature(input, 'en-us');
console.log(results);
Other packages similar to @microsoft/recognizers-text
compromise
Compromise is a lightweight NLP library for processing and extracting information from text. It offers functionalities such as part-of-speech tagging, named entity recognition, and text normalization. Compared to @microsoft/recognizers-text, Compromise provides a broader range of NLP features but may not be as specialized in entity recognition and resolution.
natural
Natural is a general-purpose NLP library for JavaScript that includes functionalities such as tokenization, stemming, classification, and named entity recognition. It provides a wide range of NLP tools but may not be as focused on the specific entity recognition and resolution tasks that @microsoft/recognizers-text excels at.