Einstein Named Entity Recognition (Beta)

What is Einstein NER (Beta)?

NER expands to Named Entity Recognition. The NER model takes unstructured text data and identifies entities within that block of text.

NER in Einstein Bots

NER might come as new to you but if you have played around with Einstein Bots, then you have already explored the vast capabilities of NER. Here is a very interesting blog post that explores the NER application in Einstein Bots – https://chatbotslife.com/teach-einstein-bots-to-pay-attention-with-named-entity-recognition-6e60a7fa5a75

How it Works

The Einstein NER identifies a sequence of words that can be categorised as a particular entity. It then returns the type of entity and the probability.

{
  "probabilities": [
    {
      "probability": 0.9995442,
      "label": "PERSON",
      "token": "Albert Einstein",
      "span": {
        "start": 0,
        "end": 15
      },
      "normalizedData": [
        {
          "firstName": "Albert",
          "lastName": "Einstein",
          "middleName": "",
          "suffix": "",
          "type": "person"
        }
      ]
    },
    {
      "probability": 0.99969876,
      "label": "LOCATION",
      "token": "Ulm",
      "span": {
        "start": 28,
        "end": 31
      },
      "normalizedData": []
    },
       ….

For example, the word “Albert Einstein” is the token and the entity returned by the model is PERSON.

Entities Supported

Here are the entities that the NER model identifies today.

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

Let’s Try It Out!

Here is a sneak peek of what we are going to set up today.

Setting up Einstein AI

Configuring the App

  • Go to Setup | Profiles | System Administrator
  • Turn ON the visibility for the following:
  • Lightning Experience App – Einstein AI
  • Lightning Tab – Detect Entities
  • Navigate to Setup | Custom Settings
  • Click Manage
  • Create a new Org-wide Setting
  • Note: The Registered Email is the Email on the User record in Salesforce that was used to sign up for Einstein AI

Now, open the Einstein AI app from the App Launcher and it’s all yours!

Using NER in Your Code

In order to use Einstein NER, in your Apex Code, all you need to do is as shown below –

EAPI_Core.detectEntities([String:Text to Classify])

The method returns the API response body (as a string/text) from Einstein AI as is. You can either deserialize the same into a Custom Apex Wrapper or use JSONParse to interpret the response.

References

Visit – https://metamind.readme.io/docs/what-is-einstein-ner to learn more.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s