Entity Reference
The Einstein NER (beta) API supports normalization for some entities. Normalized data is returned in the normalizedData array. The type and format of the data depends on the type of entity.
CREDIT CARD
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
issuer | string | Credit card issuer. Valid values:
| 2.0 |
value | string | Value of the normalized data | 2.0 |
With the exception of the ja locale, credit card numbers are detected regardless of the locale provided in the request. When the request document is passed with ja locale, we support numbers written in full-width characters.
Examples
1"probability": 1.0,
2"label": "CREDIT-CARD-NUMBER",
3"token": "5555-5555-5555-4444",
4"span": {
5 "start": 0,
6 "end": 19
7},
8"normalizedData": [
9 {
10 "value": "5555555555554444",
11 "issuer": "Mastercard", # credit card issuer
12 "type": "credit_card"
13 }
14]Though we identify valid credit card number formats (using Luhn’s algorithm test), we do not post process the value to determine whether a number is a real-world credit card.
Note
DATETIME
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Unit of measurement for the token value. Valid values:
The unit returned by the API is determined by the unit in the token. For example, if the token is “between today and tomorrow” the unit is day. | 2.0 |
value | string | Value of the normalized data. | 2.0 |
This entity can sometimes overlap with the DURATION and NUMBER entities.
Examples
1{
2 "token": "...",
3 "label": "DATETIME",
4 "probability": 0.9787207,
5 "normalizedData": [
6 {
7 "type": "value",
8 "unit": "hour",
9 "value": "2020-02-03T17:00:00.000-08:00" // 5pm
10 },
11 ... or ...
12 {
13 "type": "range", // between 4pm and 5pm
14 "from": {
15 "type": "value",
16 "unit": "hour",
17 "value": "2020-02-03T16:00:00.000-08:00"
18 },
19 "to": {
20 "type": "value",
21 "unit": "hour",
22 "value": "2020-02-03T17:00:00.000-08:00"
23 }
24 }
25 ]
26}1{
2 "probabilities": [
3 {
4 "probability": 0.84189475,
5 "label": "DATETIME",
6 "token": "between today and tomorrow",
7 "span": {
8 "start": 22,
9 "end": 48
10 },
11 "normalizedData": [
12 {
13 "from": {
14 "value": "2020-08-10T00:00:00.000-07:00", // Today's date
15 "unit": "day",
16 "type": "value"
17 },
18 "to": {
19 "value": "2020-08-12T00:00:00.000-07:00", // Tomorrow's date
20 "unit": "day",
21 "type": "value"
22 },
23 "type": "range"
24 }
25 ]
26 }
27 ],
28 "object": "predictresponse"
29}DURATION
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Unit of measurement for the token value. Valid values:
| 2.0 |
value | string | Value of the normalized data. | 2.0 |
This entity can sometimes overlap with the DATETIME and NUMBER entities.
Example
1{
2 "token": "3 hours",
3 "label": "DURATION",
4 "probability": 0.9125207,
5 "normalizedData": [
6 {
7 "type": "value",
8 "value": "10800",
9 "unit": "second"
10 }
11 ]
12}EMAIL
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Empty for the EMAIL entity type. | 2.0 |
value | string | Value of the normalized data. | 2.0 |
The API recognizes email addresses in these two formats.
- info at salesforce dot com
- info@salesforce.com
Example
1{
2 "probabilities": [
3 {
4 "probability": 1,
5 "label": "EMAIL",
6 "token": "info at salesforce dot com",
7 "span": {
8 "start": 0,
9 "end": 26
10 },
11 "normalizedData": [
12 {
13 "value": "info@salesforce.com",
14 "unit": "",
15 "type": "value"
16 }
17 ]
18 }
19 ],
20 "object": "predictresponse"
21}LOCATION
Supports normalization: No
Example
1{
2 "token": "London",
3 "label": "LOCATION",
4 "probability": 0.9787207,
5 "normalizedData": [],
6 "span": {
7 ...
8 }
9}MONEY
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Unit of measurement for the token value. Valid values:
| 2.0 |
value | string | Value of the normalized data. For money, it’s the numeric value of the specified currency. | 2.0 |
Example
1{
2 "probabilities": [
3 {
4 "probability": 0.95074475,
5 "label": "MONEY",
6 "token": "five dollars",
7 "span": {
8 "start": 21,
9 "end": 33
10 },
11 "normalizedData": [
12 {
13 "value": "5",
14 "unit": "USD",
15 "type": "value"
16 }
17 ]
18 }
19 ],
20 "object": "predictresponse"
21}NUMBER
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Empty for the NUMBER entity type. | 2.0 |
value | string | Value of the normalized data. | 2.0 |
Example
1{
2 "probabilities": [
3 {
4 "probability": 1,
5 "label": "NUMBER",
6 "token": "Three thousand",
7 "span": {
8 "start": 0,
9 "end": 14
10 },
11 "normalizedData": [
12 {
13 "value": "3000",
14 "unit": "",
15 "type": "value"
16 }
17 ]
18 }
19 ],
20 "object": "predictresponse"
21}ORGANIZATION
Supports normalization: No
Example
1{
2 "probability": 0.9469566,
3 "label": "ORGANIZATION",
4 "token": "Salesforce",
5 "span": {
6 "start": 25,
7 "end": 35
8 },
9 "normalizedData": []
10}PERCENT
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Empty for the PERCENT entity type. | 2.0 |
value | string | Value of the normalized data. | 2.0 |
The normalized value is the percent divided by 100. For example, 50 percent is 0.5. Recognizes percentages in these formats:
- 50%
- 50 percent
Example
1// Single value example
2{
3 "token": "150%",
4 "label": "PERCENT",
5 "probability": 0.9787207,
6 "normalizedData": [
7 {
8 "type": "value",
9 "unit": "",
10 "value": "1.5"
11 }
12 ]
13}
14
15// Range value example
16{
17 "probability": 0.99382097,
18 "label": "PERCENT",
19 "token": "40-50%",
20 "span": {
21 "start": 26,
22 "end": 32
23 },
24 "normalizedData": [
25 {
26 "from": {
27 "value": "0.4",
28 "unit": "",
29 "type": "value"
30 },
31 "to": {
32 "value": "0.5",
33 "unit": "",
34 "type": "value"
35 },
36 "type": "range"
37 }
38 ]
39}PERSON
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
firstName | string | Text identified as the person’s first name. | 2.0 |
lastName | string | Text identified as the person’s last name. | 2.0 |
middleName | string | Text identified as the person’s middle name. | 2.0 |
salutation | string | Empty for the PERSON entity type. | 2.0 |
suffix | string | Text identified as the person’s suffix such as Jr., Sr., and so on. | 2.0 |
type | string | Normalization type. Valid values:
| 2.0 |
Titles are not detected. For example, for the string Dr. Jim Blimpish only Jim and Blimpish are detected.
Note
Example
1"probability": 0.99966216,
2 "label": "PERSON",
3 "token": "Marc Benioff",
4 "span": {
5 "start": 0,
6 "end": 12
7 },
8 "normalizedData": [
9 {
10 "firstName": "Marc",
11 "lastName": "Benioff",
12 "middleName": "",
13 "suffix": "",
14 "salutation": "",
15 "type": "person"
16 }
17 ]PHONE-NUMBER
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Empty for the PHONE-NUMBER entity type. | 2.0 |
value | string | Value of the normalized data. | 2.0 |
Example
1{
2 "probability": 1,
3 "label": "PHONE-NUMBER",
4 "token": "408-123-4455",
5 "span": {
6 "start": 37,
7 "end": 49
8 },
9 "normalizedData": [
10 {
11 "value": "4081234455",
12 "unit": "",
13 "type": "value"
14 }
15 ]
16}URL
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
unit | string | Empty for the URL entity type. | 2.0 |
value | string | Value of the normalized data. | 2.0 |
1{
2 "probabilities": [
3 {
4 "probability": 1,
5 "label": "URL",
6 "token": "https://developer.salesforce.com/signup.",
7 "span": {
8 "start": 58,
9 "end": 98
10 },
11 "normalizedData": [
12 {
13 "value": "https://developer.salesforce.com/signup.",
14 "unit": "",
15 "type": "value"
16 }
17 ]
18 }
19 ],
20 "object": "predictresponse"
21}SOCIAL SECURITY NUMBER
Supports normalization: Yes
Normalization fields
| Name | Type | Description | Available Version |
|---|---|---|---|
type | string | Normalization type. Valid values:
| 2.0 |
value | string | Value of the normalized data. | 2.0 |
EXAMPLE
1"probability": 1.0,
2"label": "SOCIAL-SECURITY-NUMBER",
3"token": "135-24-2244",
4"span": {
5 "start": 0,
6 "end": 11
7},
8"normalizedData": [
9 {
10 "value": "135242244",
11 "type": "social_security"
12 }
13]Though we identify valid social security number formats we do not post process the value to determine whether a number is a real-world social security number.
Note