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

Popular posts from this blog

Feedback Loops: Optimizing Image Classifiers in 3 Steps

Salesforce Einstein Vision gives you a set of powerful API's that can be used to bring image recognition capabilities into your CRM application.  Image recognition can be used for Visual search, Brand detection, Product identification and many more. With Salesforce Einstein Vision, you can leverage pre-trained image classifiers, or train your own custom classifiers to solve a vast array of image-recognition use cases, empowering end users across sales, service, and marketing to be smarter and more predictive. What is Feedback loop? A feedback loop refers to the process by which an AI model’s predicted outputs are reused to train new versions of the model. Salesforce Einstein Vision Platform provides set of powerful APIs for  adding feedback loop which improves the image classifier's prediction capabilities by using the model's misclassified images to train new versions of the model. Why we need Feedback loop? In today's world every industry uses feedback loo...

Optimising an AI Model with the Confusion Matrix

What is Einstein Platform Services? Einstein Platform Services allows developers to develop AI-powered custom models which can be used to solve an array of real-life use-cases. It empowers developers with a powerful set of Application Programming Interfaces (APIs) for building intelligent and predictive app experiences. Today, Einstein Platform Services include: Einstein Image Classification (Einstein Vision) Einstein Object Detection (Einstein Vision) Einstein Intent (Einstein Language) Einstein Sentiment (Einstein Language) These services enable developers to create custom deep learning models from unstructured text and image data, which can be trained, refined and used for building intelligent apps. Create, Train and predict Using Einstein Platform Services is a simple 3 steps process, you need to create and upload dataset like text and image data, which can be used for training a model. Once the dataset is uploaded it can be used to train the model. This traine...