The Einstein NER (beta) named-entity recognition (NER) model returns entities for a specified string.
Note
As a beta feature, Einstein NER is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature.
Request Parameters
Name | Type | Description | Available Version |
---|---|---|---|
| string | Text to classify. Maximum length is 3,000 characters. | 2.0 |
| string | Language of the document parameter. Optional. Valid values:
| 2.0 |
| string | ID of the model. Optional. Defaults to | 2.0 |
| string | Time zone of the returned DATETIME entity. Optional. Defaults to See this list of tz database time zones for valid time zones, and use the TZ database name value from the table. For example, For more information, see Get DATETIME Values in the Right Time Zone. | 2.0 |
| string | String that you can pass in to tag the prediction. Optional. Can be any value, and is returned in the response. | 2.0 |
Note
As a beta feature, Danish, Korean, and Swedish language support is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature.
Keep the following points in mind:
- Response Sort Order—The entities returned in the response are sorted by the
span
start
value. This is the start position in thedocument
parameter string of the words the the API recognizes as an entity.
Response Body
Name | Type | Description | Available Version |
---|---|---|---|
| string | Object returned; in this case, | 2.0 |
| array | Array of probabilities for the prediction. | 2.0 |
| string | Same value as request parameter. Returned only if the | 2.0 |
Probabilities Response Body
Name | Type | Description | Available Version |
---|---|---|---|
| string | Probability label for the input. Each label corresponds to an entity type. Valid values are:
| 2.0 |
| array | Array of objects that contain the details for each normalized token. | 2.0 |
| object | Contains the start and end position of the token within the input string. | 2.0 |
| string | Text from the input string that the model detects as an entity. | 2.0 |
NormalizedData Response Body
The normalizedData
array is returned for each detected entity. For some entity types, such as LOCATION, the array is returned but is empty. For other entity types, the array contains an object. The data in that object depends on what type of entity the array is associated with. For example, for the PERSON entity, the normalized data array contains an object with: firstName
, lastName
, middleName
, salutation
, suffix
, and type
.
See the Entity Reference for more information about the normalized data for each entity.
Span Response Body
Name | Type | Description | Available Version |
---|---|---|---|
| string | Ending character position of the token within the | 2.0 |
| string | Starting character position of the token within the | 2.0 |
Pass Request Parameters as JSON
When you call the NER endpoint, you can specify a Content-Type of application/json
and pass the request parameters as JSON.
{
"modelId": "ENTITIES",
"language": "en_US",
"document": "Marc Benioff, the CEO of Salesforce, gave the keynote speech at the conference in Paris last week."
}
The cURL call looks like this.
Windows
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
Linux
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