Extract names
Extracts name segments from natural text.
Testing
You can test the API in the Address Purification console.
Request parameters
Name | Type | Required | Sample value | Description |
Action | String | Yes | ExtractName | A required parameter. Set the value to ExtractName. |
AppKey | String | Yes | Axqwerasdf1a | The AppKey of your project. |
ServiceCode | String | Yes | addrp | A static field. The value is addrp. |
Text | String | Yes | 969 West Wenyi Road, Xiaoming Zhang | A segment of natural text that contains one or more names. |
DefaultProvince | String | No | Zhejiang Province | The default province. |
DefaultCity | String | No | Hangzhou City | The default city. |
DefaultDistrict | String | No | Yuhang District | The default administrative region. |
Response data
Name | Type | Example | Description |
Data | String | {"person_extract":[{"start":8,"end":11,"type":"PER","word":"Xiaoming Zhang"}],"time_used":{"rt":{"person_extract":"0.013421058654785156"},"start":"1589799959.7144244"},"status":"OK"} | start: The start position of the field in the original text. end: The end position of the field in the original text. type: The field type. PER indicates a person's name. word: The detected entity field. time_used: The time consumed by the algorithm. status: The status. |
RequestId | String | 3A9AB010-AC38-4E53-9D25-6B97238C2897 | RequestId |
Examples
Request example
http(s)://[Endpoint]/?Action=ExtractName
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=969 West Wenyi Road, Xiaoming Zhang
&<Common request parameters>Response example
XML format
<RequestId>3A9AB010-AC38-4E53-9D25-6B97238C2897</RequestId>
<Data>
<person_extract>
<start>8</start>
<end>11</end>
<type>PER</type>
<word>Xiaoming Zhang</word>
</person_extract>
<time_used>
<rt>
<person_extract>0.013421058654785156</person_extract>
</rt>
<start>1589799959.7144244</start>
</time_used>
<status>OK</status>
</Data>JSON format
{
"RequestId": "3A9AB010-AC38-4E53-9D25-6B97238C2897",
"Data": {
"person_extract": [
{
"start": 8,
"end": 11,
"type": "PER",
"word": "Xiaoming Zhang"
}
],
"time_used": {
"rt": {
"person_extract": "0.013421058654785156"
},
"start": "1589799959.7144244"
},
"status": "OK"
}
}Error codes
HTTP Code | Error code | Error message | Description |
403 | Forbidden.NoAuth | Failed to perform user authentication. | User authentication failed. |
500 | InternalError | A service error occurred. | An internal service error occurred. |
400 | InvalidParameter | The parameter is invalid. | The parameter is invalid. |
404 | ResourceDoesNotExist | The resource does not exist. | The resource does not exist. |
429 | Throttling.User | Flow control has been triggered. | Throttling was triggered. |
400 | UserStatusInvalid | The user status is invalid. | The user status is invalid. |
For more information about error codes, see the Error Center.