Skip to main content

Salesforce Einstein -Named Entity Recognition

What is Einstein NER(Beta) ?

NER, or Named Entity Recognition, is a process of recognizing/extracting/classifying named entities from simple text into meaningful categories like person, organization, email, phone etc. The input to the NER model is unstructured text, and after processing it identifies entities within that text. 

Einstein Platform Services

Einstein Platform Services brings a wide variety of machine learning capabilities — such as image recognition, sentiment, intent and more — directly into Salesforce’s trusted and secure infrastructure. You can simply deploy these services using a single line of code into any Salesforce page or build a reusable AI-powered Lightning Web Component. Once the details are worked upon, admins can easily deploy to end-users with just a few clicks. An interesting fact about this is that you wouldn't need any model setup, training or data science skills to work on Einstein NER.

Named Entity Recognition(Beta) is new addition to Salesforce’s Einstein Platform Service APIs and one of the powerful tools for identifying and categorizing named entity from the given input.

This blog post explains the basics of NER and available Einstein Platform Service APIs.

NER in Action :

Let’s take an example of below sentence

Marc Benioff, the CEO of Salesforce, gave the keynote speech at the conference in Paris last week.
NER Example
Named Entity Recognition Example

We can see in above example that there are many named entities like, Marc Benioff (Name of person), Salesforce (Organization), Paris (Location) and Last Week(Date)

The model identifies a sequence of word(s) (the token) that are categorized as a particular entity. The model returns the type of entity along with the probability of being into that category.

Here are the entities that the NER model identifies.

  • DATETIME
  • DURATION
  • EMAIL
  • LOCATION
  • MONEY
  • NUMBER
  • ORGANIZATION
  • PERCENT
  • PERSON
  • PHONE-NUMBER
  • URL

Powerful Normalization Capabilities with Einstein NER:

Along with detecting the Named Entities, NER model also performs normalization of certain types of entities.

What does it mean that the model normalizes certain types of entities? It means that when you send text in for prediction and the model identifies an entity that supports normalization, the API returns the actual value for the entity and other information.

For example, if today is October 21, 2020, and your text contains the word yesterday, the model returns a normalized value of 2020-10-20 00:00:00.

Similarly, if your word contains Five dollars the model will return value as 5, and unit as USD.

For the list of all the supported entity types and the normalization format check this link.

Using Einstein NER APIs:

If you are not a developer and you still want to get hold of various Einstein Platform offerings or want to try POC; you can install the Einstein Playground app from Appexchange. This article will give you a jump start for using the app. Additionally you can also use documentation provided in the resources section.

API Details:

Endpoint: https://api.einstein.ai/v2/language/entities
Method: POST
Request Parameters:

Request Parameters

Response Body:

Response Body
Response Body-Probabilities

Sample Request

curl -X POST -H “Authorization: Bearer <TOKEN>” -H “Cache-Control: no-cache” -H “Content-Type: multipart/form-data” -F “document=Marc Benioff, the CEO of Salesforce, gave the keynote speech at the conference in Paris last week.” https://api.einstein.ai/v2/language/entities

or

curl -X POST -H “Authorization: Bearer <TOKEN>” -H “Content-Type: application/json” -d “{\”modelId\”:\”ENTITIES\”, \”language\”: \”en_US\”, \”document\”:\”Marc Benioff, the CEO of Salesforce, gave the keynote speech at the conference in Paris last week.\”}” https://api.einstein.ai/v2/language/entities

Sample Response

Sample response data

NER is very useful for retrieving key Entities details quickly from the long texts. Examples may include retrieving key candidate details from the resume or reading digital business cards.


Additional Resources:

Documentation: Einstein Platform Services Developer Guide 

Press Release: Salesforce Introduces New Einstein Services

Appexchange: Einstein Vision and Language Model Builder


Comments