Address anomaly detection
Address anomaly detection validates user-input addresses. This service inspects addresses for correct formatting, completeness, and factual errors. It then returns any detected anomaly types, such as administrative region errors, non-existent road information, or missing villages or communities.
Testing
You can perform API testing in the Address Purification console.
Request parameters
Name | Type | Required | Example | Description |
Action | String | Yes | AddressAssessment | A required parameter. Set the value to AddressAssessment. |
AppKey | String | Yes | Axqwerasdf1a | The AppKey of the project. |
ServiceCode | String | Yes | addrp | A static field. Set the value to addrp. |
Text | String | Yes | Alibaba Xixi Park | The text content. |
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. |
Return data
Name | Type | Sample value | Description |
Data | String | {"address_assessment": {"error_code": "0102020204000000", "error_content": ["Missing information, but the address is understandable", "No administrative region", "Missing road name", "Missing administrative village"]}, "status": "OK", "time_used": { "rt": {"basic_chunking": 0.0172121524810791, "address_assessment": 0.0002608299255371094, "structure":0.0003032684326171875}, "start": 1669001158.3608806}} | address_assessment: The result of the address anomaly detection. error_code: The return code of the detection result. For more information, see the encoding rules below. error_content: The text description of the return code. For more information, see the encoding rules below. time_used: The time taken by the algorithm to process the request. status: The status. |
RequestId | String | E0627DDE-28D7-4C00-A611-E047DF81AF05 | RequestId |
Examples
Request example
http(s)://[Endpoint]/?Action=AddressAssessment
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=Alibaba Xixi Park
&<Common request parameters>Response example
XML format
<RequestId>226BD68D-6208-4140-A6EC-2F2BF434B601</RequestId>
<Data>
<address_assessment>
<error_code>0102020204000000</error_code>
<error_content>Missing information, but the address is understandable</error_content>
<error_content>No administrative region</error_content>
<error_content>Missing road name</error_content>
<error_content>Missing administrative village</error_content>
</address_assessment>
<status>OK</status>
<time_used>
<rt>
<basic_chunking>0.0172121524810791</basic_chunking>
<address_assessment>0.0002608299255371094</address_assessment>
<structure>0.0003032684326171875</structure>
</rt>
<start>1669001158.3608806</start>
</time_used>
</Data>JSON format
{
"RequestId": "226BD68D-6208-4140-A6EC-2F2BF434B601",
"Data": {
"address_assessment": {
"error_code": "0102020204000000",
"error_content": ["Missing information, but the address is understandable", "No administrative region", "Missing road name", "Missing administrative village"]
},
"status": "OK",
"time_used": {
"rt": {
"basic_chunking": 0.0172121524810791,
"address_assessment": 0.0002608299255371094,
"structure": 0.0003032684326171875
},
"start": 1669001158.3608806
}
}
}Encoding rules for address anomaly detection types
The return code consists of 16 digits.
01 00 00 00 00 00 00 00
Digits 1 and 2 indicate the return code version number. The current version is 01.
Digits 3 and 4 indicate the general problem category. For more information, see the table below. A value less than 50 indicates a non-standard format. A value of 50 or greater indicates an anomaly or error.
Digits 5 and 6 indicate anomalies in the administrative region. For more information, see the table below. A value less than 50 indicates a non-standard format. A value of 50 or greater indicates an anomaly or error.
Digits 7 and 8 indicate anomalies in the road network information. For more information, see the table below.
Digits 9 and 10 indicate anomalies in the target entity. For more information, see the table below.
Digits 11 and 12 indicate anomalies in the target address details. For more information, see the table below.
Digits 13 to 16 are reserved.
Check item | Primary check | Error type | Advanced check | Error code |
General problem category | Overall address issue | 00: Correct 01: Low density of address elements 02: Missing information, but the address is understandable. This includes missing administrative regions that can be inferred, having only a road name and number or a POI, and missing detailed address information. 03: The address range is too broad. It lacks information below the administrative village or community level. 04: Potential conflict, such as multiple roads or POIs. 51: Factual error in the administrative region. The general category mapping is incorrect. 52: Factual error in the target address. | None | None |
Administrative region | Completeness and correctness of the administrative region, including changes and aliases. Checks for conflicts. | 00: Correct 01: Uses legacy regional information or an alias, including abbreviations. 02: No administrative region. 03: Missing part of the province-level administrative region that cannot be inferred. 04: Missing part of the city-level administrative region that cannot be inferred. 05: Missing part of the district- or county-level administrative region that cannot be inferred. 06: Missing part of the township- or town-level administrative region that cannot be inferred. 51: Administrative region conflict. 52: Province-level administrative region error (does not exist). 53: City-level administrative region error (does not exist). 54: District-level administrative region error (does not exist). 55: Town-level administrative region error (does not exist). | None | None |
Road network information | Presence of road network information. Checks if the road number follows the rules. | 00: Correct 01: Too many roads. 02: Missing road name. 03: Missing road number. 04: Abnormal road number. | Checks if the road name actually exists. | 51: Road name does not exist. 52: Road number does not exist. |
Target entity information | Simple quantity check. Checks for multiple or missing POIs. | 00: Correct 01: Multiple POIs. 02: Only unnamed POIs exist. 03: No POI. 04: Missing administrative village. 51: Multiple village names at the same level. 52: Missing natural feature name. | Factuality check. Checks for typos in place names, existence, adjacency of POIs, and correspondence between POIs and road names or numbers. | 53: Place name does not exist. 54: POI does not correspond to the road name and number. |
Target address details | Checks if the number follows the rules. | 01: Duplicate elements found. 02: Abnormal detailed address. | Checks if the number exists. | 51: Detailed address does not exist. |
Auxiliary information | No check performed. | None | None | None |
Non-address elements | No check performed. | None | None | None |
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, see the Error Center.