文档

地址抽取

从自然文本中抽取地址片段。

测试

您可以在地址标准化产品控制台进行API测试

请求参数

名称

类型

是否必选

示例值

描述

Action

String

ExtractAddress

系统规定参数。取值:ExtractAddress。

AppKey

String

Axqwerasdf1a

项目AppKey

ServiceCode

String

addrp

固定值:addrp

Text

String

文一西路969号

文本内容

DefaultProvince

String

浙江省

默认省份

DefaultCity

String

杭州市

默认城市

DefaultDistrict

String

余杭区

默认行政区

返回数据

名称

类型

示例值

描述

Data

String

{"location_extract":[{"start":0,"end":8,"type":"LOC","word":"文一西路969号"}],"time_used":{"rt":{"location_extract":"0.008937358856201172"},"start":"1589799727.438162"},"status":"OK"}

start:原文中字段起始位置

end:原文中字段结束位置

type:字段类型,LOC是指location,地址

word:识别出的实体字段

time_used:算法处理耗时

status:状态

RequestId

String

E0627DDE-28D7-4C00-A611-E047DF81AF05

请求Id

示例

请求示例

http(s)://[Endpoint]/?Action=ExtractAddress
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=文一西路969号
&<公共请求参数>

正常返回示例

XML格式

<RequestId>E0627DDE-28D7-4C00-A611-E047DF81AF05</RequestId>
<Data>
    <location_extract>
        <start>0</start>
        <end>8</end>
        <type>LOC</type>
        <word>文一西路969号</word>
    </location_extract>
    <time_used>
        <rt>
            <location_extract>0.008937358856201172</location_extract>
        </rt>
        <start>1589799727.438162</start>
    </time_used>
    <status>OK</status>
</Data>

JSON格式

{
  "RequestId": "E0627DDE-28D7-4C00-A611-E047DF81AF05",
  "Data": {
    "location_extract": [
      {
        "start": 0,
        "end": 8,
        "type": "LOC",
        "word": "文一西路969号"
      }
    ],
    "time_used": {
      "rt": {
        "location_extract": "0.008937358856201172"
      },
      "start": "1589799727.438162"
    },
    "status": "OK"
  }
}

错误码

HttpCode

错误码

错误信息

描述

403

Forbidden.NoAuth

Failed to perform user authentication.

用户鉴权失败

500

InternalError

A service error occurred.

服务内部异常

400

InvalidParameter

The parameter is invalid.

参数无效

404

ResourceDoesNotExist

The resource does not exist.

资源不存在

429

Throttling.User

Flow control has been triggered.

触发流控

400

UserStatusInvalid

The user status is invalid.

用户状态无效

访问错误中心查看更多错误码。

  • 本页导读 (0)
文档反馈