v1

latestSwagger 2.0raw.githubusercontent.com2022-07-0122047.3 KB
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

phrasestring

The phrase to extract named entities from.

language'LANGUAGE_INVALID' | 'LANGUAGE_UNDETERMINED' | 'ENG' | 'RUS' | 'DEU' | 'FRA' | 'ITA' | 'JPN' | 'SPA' | 'CEB' | 'TUR' | 'POR' | 'UKR' | 'EPO' | 'POL' | 'SWE' | 'NLD' | 'HEB' | 'ZHO' | 'HUN' | 'ARA' | 'CAT' | 'FIN' | 'CES' | 'FAS' | 'SRP' | 'ELL' | 'VIE' | 'BUL' | 'KOR' | 'NOR' | 'MKD' | 'RON' | 'IND' | 'THA' | 'HYE' | 'DAN' | 'TAM' | 'HIN' | 'HRV' | 'HBS' | 'BEL' | 'KAT' | 'TEL' | 'KAZ' | 'WAR' | 'LIT' | 'GLG' | 'SLK' | 'BEN' | 'EUS' | 'SLV' | 'KAN' | 'MAL' | 'MAR' | 'EST' | 'AZE' | 'MSA' | 'SQI' | 'LAT' | 'BOS' | 'NNO' | 'URD' | 'LAV' | 'MYA' | 'TAT' | 'AFR' | 'OCI' | 'NDS' | 'KIR' | 'AST' | 'TGL' | 'ISL' | 'INA' | 'SIN' | 'GUJ' | 'KHM' | 'BRE' | 'BAK' | 'UZB' | 'BOD' | 'PAN' | 'VOL' | 'ALS' | 'NEP' | 'CYM' | 'JBO' | 'FRY' | 'MON' | 'LTZ' | 'CHE' | 'UIG' | 'TGK' | 'SCO' | 'SAN' | 'CHV' | 'JAV' | 'MIN' | 'IDO' | 'ORI' | 'ASM' | 'NEW' | 'GLE' | 'MLG' | 'ARG' | 'CKB' | 'SWA' | 'BAR' | 'LMO' | 'YID' | 'ARZ' | 'MHR' | 'AZB' | 'SAH' | 'PNB' | 'SUN' | 'BPY' | 'PMS' | 'ILO' | 'WUU' | 'KUR' | 'PUS' | 'ILE' | 'XMF' | 'YUE' | 'GOM' | 'LIM' | 'MWL' | 'COR' | 'SND' | 'HSB' | 'SCN' | 'GLA' | 'PAM' | 'BHO' | 'MAI' | 'VEC' | 'MLT' | 'DIV' | 'WLN' | 'MZN' | 'AMH' | 'QUE' | 'CBK' | 'TUK' | 'ROH' | 'OSS' | 'VLS' | 'YOR' | 'LAO' | 'LEZ' | 'SOM' | 'MYV' | 'DIQ' | 'MRJ' | 'DSB' | 'FRR' | 'HAT' | 'GRN' | 'BXR' | 'KOM' | 'SRD' | 'KRC' | 'BCL' | 'NAP' | 'GLV' | 'AVA' | 'RUE' | 'XAL' | 'PFL' | 'DTY' | 'HIF' | 'COS' | 'LRC' | 'VEP' | 'TYV' | 'NOB' | 'SNA' | 'KIN' | 'IBO' | 'SMO' | 'SOT' | 'MRI' | 'WOL' | 'XHO' | 'HAU' | 'HAW' | 'NYA' | 'ZUL' | 'HMN'

Language code in ISO639-3 format. More info can be found here: https://iso639-3.sil.org/code_tables/639/data.

entityTypesV1EntityType[]

A collection of entity types that can be detected. If empty, all found types are returned.

timezonestring

The name of the timezone the samples should be detected in. For time or date related entities this ensures that the values are converted to the correct timezone. For an overview of available timezones see this list.

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"
    }
  ]
}
All 2 operations