接口路径(新):http://api.okayapi.com/api/App/Scws/GetWords
接口路径(旧):http://api.okayapi.com/?s=App.Scws.GetWords
接口描述: NLP分词,可进行中文分词。
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
text | String | Required | 我爱你中国 | 待进行中文分词的文本 |
请求:
{OKAYAPI_API_HOST}/?s=App.Scws.GetWords&text=我爱你中国&app_key={你的app_key}&sign={动态签名}
返回:
{
"ret": 200,
"data": {
"err_code": 0,
"err_msg": "",
"words": [
{
"word": "我爱你",
"off": 0,
"len": 9,
"idf": 4.929999828338623,
"attr": "n"
},
{
"word": "中国",
"off": 9,
"len": 6,
"idf": 6.260000228881836,
"attr": "ns"
}
]
},
"msg": "小白开放接口:App.Scws.GetWords"
}
KEY | Type | Description |
---|---|---|
words | Array | 分词的结果 |
words[].word | String | 词本身 |
words[].idf | Float | 逆文本词频 |
words[].off | Int | 该词在原文本路的位置 |
words[].attr | String | 词性,北大词性标注版本:
|
Power by OkayAPI.com Contact us (WA: okayapi OR Email: chanzonghuang@gmail.com).
Timezone: America/New_York Jan/19/2025 18:06:14