NamedEntityRecognition
Extract named entities from a phrase
Extracts named entities from a phrase. If no entities can be found, it returns an empty collection of entities. Each entity contains one or more (ambiguous) interpretations. Each recognized entity will most likely contain only one possible interpretation.
You can limit the named entities to search for by explicitly providing the entity types. If no types are specified upfront, all entity types will be extracted and returned if possible.
If no language is specified upfront, the Named Entity Recognition API will try to infer it automatically before proceeding with named entity recognition. An inferred or pre-specified language that is not supported will yield an error.
post/api/v1/predict-entities
Request body
Example request
{
"entityTypes": [
"GEOPOLITICAL",
"URL",
"TIME",
"NUMERAL"
],
"language": "ENG",
"phrase": "Today we're in Amsterdam, building two chatbots using https://messagebird.com/en/solutions/faq-bots",
"timezone": "Europe/Amsterdam"
}Response
A successful response.
Example response
{
"entities": [
{
"ambiguous": false,
"endCharIndex": 5,
"entityValues": [
{
"time": {
"value": "2021-09-21T19:00:00.000+00:00"
}
}
],
"startCharIndex": 0,
"text": "Today",
"type": "TIME"
},
{
"ambiguous": false,
"endCharIndex": 24,
"entityValues": [
{}
],
"startCharIndex": 15,
"text": "Amsterdam",
"type": "GEOPOLITICAL"
},
{
"ambiguous": false,
"endCharIndex": 38,
"entityValues": [
{
"numeral": {
"value": "5"
}
}
],
"startCharIndex": 35,
"text": "two",
"type": "NUMERAL"
},
{
"ambiguous": false,
"endCharIndex": 99,
"entityValues": [
{
"url": {
"domain": "messagebird.com",
"value": "https://messagebird.com/en/solutions/faq-bots"
}
}
],
"startCharIndex": 54,
"text": "https://messagebird.com/en/solutions/faq-bots",
"type": "URL"
}
]
}