Skip to content

Entity Extraction

To implement the Entity Extraction you'll first need to get the API key from the Dashboard and the make a POST request to the API by doing the following.

Making the request

Access the API by making a POST request to the following url

POST - /v1/entity

https://api.lamina.xyz/v1/entity

Add the following parameters to start analysing data

Headers

Authorization: YOUR_API_KEY_HERE

Request Body - Form Data

"text": "Your text data here"

Example

Following is an example of a request to the Sentiment Analysis API

Request
curl -X POST \
  https://api.lamina.xyz/v1/entity \
  -H 'Authorization: <YOUR_API_KEY>' \
  -F 'text=Earlier this week I talked to John Doe who lives in New York'
Response
{  
   "entities":[  
      {  
         "start_char":0,
         "end_char":17,
         "text":"Earlier this week",
         "entity":"DATE"
      },
      {  
         "start_char":30,
         "end_char":38,
         "text":"John Doe",
         "entity":"PERSON"
      },
      {  
         "start_char":52,
         "end_char":60,
         "text":"New York",
         "entity":"GPE"
      }
   ]
}

Entity Categories

The response from the Entity Extraction API contains entities labelled with their corresponding category codenames. These codenames are listed below.

  • PERSON - Names of people
  • GPE - Geopolitical entities
  • ORG - Names of Organizations
  • DATE - All references to dates
  • TIME - All references to time
  • LANGUAGE - Names of languages
  • MONEY - Cash or money
  • ORDINAL - Positions in a series, eg: First, Second etc.
  • PERCENT - Percentages
  • CARDINAL - Numbers
  • NORP - Ethnic references
  • LOC - Line of Control, eg: military line of control
  • EVENT - Events
  • PRODUCT - Products
  • FACILITY - Facilities
  • WORK OF ART - Works of art
  • QUANTITY - Quantities