Choose where you’d like to start

Find Named Entities

Description

The zoho.ai. findNamedEntities task extracts the parameters relevant to the specified intent from the given text. Simply put, it identifies the items that fall under the specified entity types (such as country, state, city, region, postcode, and more) in the given text. For example, if the given text is "I'm a teacher" and the specified entity type is "occupation", the item extracted is "teacher".

Note: 
  • This task only supports English.
  • The prediction results may not be accurate, which is also the case with any AI prediction. However, we are working on making it better.
  • The prediction results are dynamic. The same script may produce different outcomes at different times based on how much the machine has learned.

Syntax

<response> = zoho.ai.findNamedEntities(<sentence>,<entity_type>);

where:

ParamsData typeDescription

<response>

KEY-VALUE

Specifies the items that fall under the provided entity types and the status of the executed task

<sentence>

TEXT

Specifies the sentence from which the items need to be extracted

<entity_types>

TEXT/LIST

Specifies the entity types.

The following are the allowed entity types:

  • country
  • state
  • city
  • region
  • postcode
  • countrycode
  • person
  • org
  • places
  • planet
  • occupation
  • food
  • plant
  • animal
  • color
  • element
  • emoji
  • chemical
  • area
  • skills
  • degree
  • iso
  • team
  • datetime

Example 1

The following script extracts all the items that matches the entity - "person" from the given text - "Hello, I'm Shawn.", i.e, it lists all the person names encountered in the specified sentence.

 response = zoho.ai.findNamedEntities("Hello, I'm Shawn.","person");

where:

response
The KEY-VALUE response that represents the items that fall under the specified entity type and the status of the executed task. Here, the item returned is Shawn.
"Hello, I'm Shawn."
The TEXT that represents the text from which the items need to be extracted.
"person"
The TEXT that represents the entity type.

Example 2

The following script extracts all the items that matches the entity types carried by the collection - entity_types from the given text, categorized accordingly.

 text = "Hello, I'm Shawn. My interests are data science and Internet Of Things";
 entity_types=List();
 entity_types.add("person");
 entity_types.add("skills");
 
 response = zoho.ai.findNamedEntities(text,entity_types);

where:

text
The TEXT variable that holds the text from which the items need to be extracted.
entity_types
The LIST variable that holds the entity types.

Response Format

Success Response

  • The success response returned is of the following format.

     {
     "data": {
     "items": [
     {
     "skills": [
     "data science",
     "Internet Of Things"
     ],
     "person": [
     "Shawn"
     ]
     }
     ]
     },
     "message": "OK",
     "status": 200
     }
     

    Failure Response

    • The failure response returned for an empty parameters is of the following format.

       {
       "message": "EMPTY_VALUE_NOT_ALLOWED",
       "status": 400
       }
     

    Related Links

Get Started Now

Execute