Contextual address inference
This service infers addresses from multi-turn conversations. It recognizes text from speech, identifies address-related information, and uses context to understand the conversation. The service corrects and completes spoken addresses. It then returns the top three results, sorted by relevance. This is useful for inferring addresses in scenarios such as alarm reporting, repair requests, and logistics.
Test
You can perform an API test in the Address Purification console.
Request parameters
Name | Type | Required | Example | Description |
Action | String | Yes | AddressInference | A required parameter. Value: AddressInference |
AppKey | String | Yes | Axqwerasdf1a | The AppKey of the project. |
ServiceCode | String | Yes | addrp | Static field: addrp |
Text | String | Yes | Let's meet at the entrance of Alibaba, the one in Binjiang District. | 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. |
Response data
Name | Type | Example | Description |
Data | String | { "address_inference":[{ "address":"699 Wangshang Road", "divcode":"330108", "name":"Alibaba Binjiang Campus", "id":"B0FFG083SL", "lxly":"30.1896,120.190371", "std_addr":"Alibaba Binjiang Campus, 699 Wangshang Road, Changhe Street, Binjiang District, Hangzhou, Zhejiang Province"}, {"address":"969 West Wenyi Road", "divcode":"330110", "name":"Alibaba Xixi Campus (District A)", "id":"B023B1D4BX", "lxly":"30.278984,120.025746", "std_addr":"Alibaba Xixi Campus (District A), 969 West Wenyi Road, Wuchang Street, Yuhang District, Hangzhou, Zhejiang Province"}, {"address":"Xiwang Road", "divcode":"330110", "name":"Alibaba Xixi Campus (District B)", "id":"B0FFGUEOJ9", "lxly":"30.275962,120.027276", "std_addr":"Alibaba Xixi Campus (District B), Xiwang Road, Wuchang Street, Yuhang District, Hangzhou, Zhejiang Province"}], "status":"OK", "time_used":{ "rt":{ "dialog_extract":0.0078012943267822266, "address_inference":3.235727548599243}, "start":1675070387.20365}} | address_inference: The result of contextual address inference. name: The place name. divcode: The postal code. Address: std_addr: The standardized address. lxly: The latitude and longitude coordinates. 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=AddressInference
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=Let's meet at the entrance of Alibaba, the one in Binjiang District.
&<Common request parameters>Successful response example
XML format
<RequestId>226BD68D-6208-4140-A6EC-2F2BF434B601</RequestId>
<Data>
<address_inference>
<address>699 Wangshang Road</address>
<divcode>330108</divcode>
<name>Alibaba Binjiang Campus</name>
<id>B0FFG083SL</id>
<lxly>30.1896,120.190371</lxly>
<std_addr>Alibaba Binjiang Campus, 699 Wangshang Road, Changhe Street, Binjiang District, Hangzhou, Zhejiang Province</std_addr>
</address_inference>
<address_inference>
<address>969 West Wenyi Road</address>
<divcode>330110</divcode>
<name>Alibaba Xixi Campus (District A)</name>
<id>B023B1D4BX</id>
<lxly>30.278984,120.025746</lxly>
<std_addr>Alibaba Xixi Campus (District A), 969 West Wenyi Road, Wuchang Street, Yuhang District, Hangzhou, Zhejiang Province</std_addr>
</address_inference>
<address_inference>
<address>Xiwang Road</address>
<divcode>330110</divcode>
<name>Alibaba Xixi Campus (District B)</name>
<id>B0FFGUEOJ9</id>
<lxly>30.275962,120.027276</lxly>
<std_addr>Alibaba Xixi Campus (District B), Xiwang Road, Wuchang Street, Yuhang District, Hangzhou, Zhejiang Province</std_addr>
</address_inference>
<status>OK</status>
<time_used>
<rt>
<dialog_extract>0.0078012943267822266</dialog_extract>
<address_inference>3.235727548599243</address_inference>
</rt>
<start>1675070387.20365</start>
</time_used>
</Data>
JSON format
{
"RequestId": "226BD68D-6208-4140-A6EC-2F2BF434B601",
"Data": {
"address_inference":[
{
"address":"699 Wangshang Road",
"divcode":"330108",
"name":"Alibaba Binjiang Campus",
"id":"B0FFG083SL",
"lxly":"30.1896,120.190371",
"std_addr":"Alibaba Binjiang Campus, 699 Wangshang Road, Changhe Street, Binjiang District, Hangzhou, Zhejiang Province"
},
{
"address":"969 West Wenyi Road",
"divcode":"330110",
"name":"Alibaba Xixi Campus (District A)",
"id":"B023B1D4BX",
"lxly":"30.278984,120.025746",
"std_addr":"Alibaba Xixi Campus (District A), 969 West Wenyi Road, Wuchang Street, Yuhang District, Hangzhou, Zhejiang Province"
},
{
"address":"Xiwang Road",
"divcode":"330110",
"name":"Alibaba Xixi Campus (District B)",
"id":"B0FFGUEOJ9",
"lxly":"30.275962,120.027276",
"std_addr":"Alibaba Xixi Campus (District B), Xiwang Road, Wuchang Street, Yuhang District, Hangzhou, Zhejiang Province"
}
],
"status":"OK",
"time_used":{
"rt":{
"dialog_extract":0.0078012943267822266,
"address_inference":3.235727548599243
},
"start":1675070387.20365
}
}
}Error codes
HttpCode | 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 fault 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 error codes, see the Error Center.