Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • How to Leverage Model Context Protocol (MCP) to Enhance Salesforce AI
    • Top Mistakes Developers Make in Salesforce Apex Triggers
    • Introducing Agentforce3 to Salesforce Developers
    • The Ultimate Guide to Apex Order of Execution for Developers
    • How to Handle Bulkification in Apex with Real-World Use Cases
    • How to Confidently Manage Transactions in Salesforce Apex
    • Building a Dynamic Tree Grid in Lightning Web Component
    • 10 Salesforce Chrome Extensions to Boost Your Productivity
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Tuesday, July 29
    • Home
    • Salesforce Platform
      • Architecture
      • Apex
      • Lightning Web Components
      • Integration
      • Flows & Automation
      • Best Practices
      • Questions
      • News
      • Books Testimonial
    • Industries
      • Artificial Intelligence
    • Hire Me
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Downloads
      • Salesforce Release Notes
      • Apex Coding Guidelines
    • About Us
      • Privacy Policy
    • Contact Us
    SalesforceCodex
    Home»Salesforce»Einstein»Named Entity Recognition using Salesforce Einstein API

    Named Entity Recognition using Salesforce Einstein API

    Dhanik Lal SahniBy Dhanik Lal SahniJanuary 1, 2021Updated:January 12, 20251 Comment3 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Named Entity Recognition using Salesforce Einstein API
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Named entity recognition (NER) or entity identification is an AI technique that automatically identifies named entities in given text and classifies them into predefined categories. Entities can be names of people, organizations, locations, times, quantities, monetary values, percentages, and more.

    named entity recognition | salesforcecodex

    Extracting these entities helps businesses easily analyze huge amounts of unstructured data, like open-ended survey responses, emails, social media conversations, and more. This extracted data contains valuable information and insights for business.

    Named entity recognition has many different usage, such as text summarization, question answering or data categorization. Like to know relevant pieces of data from incoming support tickets, like company names, product names, or series numbers, making it easier to route tickets to the most suitable agent or team for handling that issue.

    Salesforce Einstein API (beta) has capability to recognize named entities. In this post we will see step by step process to extract named entities from text lines.

    Below steps will be required to get named entities from given text using Salesforce Einstein API.

    1. Create account in Einstein Platform Services
    2. Create Private Key and Generate Token
    3. Extract Named Entities
    4. Format response to show in LWC data table

    For Step 1 and Step 2 can check our post Create OCR App using Salesforce Einstein OCR API

    3. Extract Named Entities

    The Einstein NER (beta) named-entity recognition (NER) model returns entities for a given text. This api right now supporting below entities

    • Datetime
    • Duration
    • Email
    • Location
    • Money
    • Number
    • Organization
    • Percent
    • Person
    • Phone-number
    • Url

    For each entity, different set of information will return from API. As example, if we request entities for text ‘Marc Benioff, the CEO of Salesforce, gave the keynote speech at the conference in Paris last week.’ We will get below entities

    Person : First Name : Marc , Last Name : Benioff

    Organization: Salesforce

    Datetime: Last week

    Let us use Einstein Entity API to get entity information. Below are API request detail which need to submitted for getting entity information.

    API Parameter/detailValues
    Endpointhttps://api.einstein.ai/v2/language/entities
    content-typemultipart/form-data; charset=”UTF-8″
    Method TypePOST
    AuthorizationBearer {{token}}
    Cache-Controlno-cache
    Bodydocument={{text}},
    modelId=’ENTITIES’

    For this let us create apex class EntityDetectionService to call Einstein Entity API.

    Based on passed text, we will get response from API.

    4. Format response to show in LWC data table

    We have response text from Einstein Entity API, let us change that into tabular format. For that we have to parse JSON text into object. Create a response class to hold response data.

    In step 3, we have created service class which will get entity information from passed text. Let us call that service class from controller apex class which will be called by LWC component.

    Let us create a LWC component which will provide text to extract entity information. This LWC component will use EntityExtractor.getEntityText method. We can use data table component show entity information. I have used only top level information but we can get further information for each entity type like for person type we can get first name, last name etc.

    Test Page:

    named entity | named entity in Salesforce | Salesforce named entity

    Reference:

    https://monkeylearn.com/blog/named-entity-recognition/

    Related Posts

    1. Create OCR App using Salesforce Einstein OCR API
    2. Extract Driver License Detail from Image using Einstein API
    3. Extract Text From Image using Google Cloud Vision
    einstein einstein api lightning component Lightning web component lightning-datatable lwc named entity named entity recognition named entity recognition api salesforce api
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleUsing Salesforce Bulk API V2
    Next Article Top 10 Best Practice for Lightning Flow
    Dhanik Lal Sahni
    • Website
    • Facebook
    • X (Twitter)

    With over 18 years of experience in web-based application development, I specialize in Salesforce technology and its ecosystem. My journey has equipped me with expertise in a diverse range of technologies including .NET, .NET Core, MS Dynamics CRM, Azure, Oracle, and SQL Server. I am dedicated to staying at the forefront of technological advancements and continuously researching new developments in the Salesforce realm. My focus remains on leveraging technology to create innovative solutions that drive business success.

    Related Posts

    By Dhanik Lal Sahni6 Mins Read

    How to Leverage Model Context Protocol (MCP) to Enhance Salesforce AI

    July 28, 2025
    By Dhanik Lal Sahni7 Mins Read

    Top Mistakes Developers Make in Salesforce Apex Triggers

    July 25, 2025
    By Dhanik Lal Sahni14 Mins Read

    The Ultimate Guide to Apex Order of Execution for Developers

    July 20, 2025
    View 1 Comment

    1 Comment

    1. Pingback: Extract Driver License Detail from Image using Einstein API | SalesforceCodex

    Leave A Reply Cancel Reply

    Ranked #1 Salesforce Developer Blog by SalesforceBen.com
    SFBenTopDeveloper
    Ranked #4 Salesforce Developer Blog by ApexHours.com
    ApexHoursTopDevelopers
    Categories
    Archives
    Tags
    apex (116) apex best practices (5) apex code best practice (10) apex code optimization (6) Apex logging (4) apex rest (11) apex trigger best practices (6) architecture (22) Asynchronous apex (9) AWS (5) batch apex (10) best code practice (4) code optimization (9) custom metadata types (5) design principle (9) flow (16) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (66) lightning-combobox (5) lightning-datatable (10) lightning component (32) Lightning web component (64) lwc (53) named credential (8) optimize apex (5) optimize apex code (6) optimize apex trigger (5) Permission set (4) Queueable (9) queueable apex (4) rest api (23) salesforce (149) salesforce apex (52) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (5) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    MailChimp

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.