Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    • Top 10 PMD Issues Salesforce Developers Should Focus on in Apex
    • How to Use Graph API for Outlook-Salesforce Connection
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Thursday, May 29
    • Home
    • Architecture
    • Salesforce
      • News
      • Apex
      • Integration
      • Books Testimonial
    • Questions
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Integration Posts
    • Downloads
    • About Us
      • Privacy Policy
    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 Sahni4 Mins Read

    How to Build a Generic Modal Window in Lightning Web Component

    May 26, 2025
    By Dhanik Lal Sahni6 Mins Read

    Top 10 Salesforce Flow Features of Salesforce Summer ’25

    May 11, 2025
    By Dhanik Lal Sahni6 Mins Read

    Unlock the Power of Vibe Coding in Salesforce

    April 30, 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
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) 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

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) 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

    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.