接口文档: http://api.yesapi.cn/docs-api-App.Scws.GetWords.html
接口路径: http://api.yesapi.cn/api/App/Scws/GetWords
示例:
对【我爱你中国】这一句进行分词,接口返回结果是:
{
"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"
}
又如,对以下这句话进行分词。
曾经有一段真挚的爱情摆在我面前我没有珍惜
接口结果是:
{
"err_code": 0,
"err_msg": "V3.3.0 YesApi App.Scws.GetWords 2022-04-29 14:14:53",
"words": [
{
"word": "曾经",
"off": 0,
"len": 6,
"idf": 4.909999847412109,
"attr": "d"
},
{
"word": "有",
"off": 6,
"len": 3,
"idf": 0,
"attr": "v"
},
{
"word": "一",
"off": 9,
"len": 3,
"idf": 0,
"attr": "m"
},
{
"word": "段",
"off": 12,
"len": 3,
"idf": 0,
"attr": "q"
},
{
"word": "真挚",
"off": 15,
"len": 6,
"idf": 5.889999866485596,
"attr": "an"
},
{
"word": "的",
"off": 21,
"len": 3,
"idf": 0,
"attr": "uj"
},
{
"word": "爱情",
"off": 24,
"len": 6,
"idf": 4.53000020980835,
"attr": "n"
},
{
"word": "摆在",
"off": 30,
"len": 6,
"idf": 5.639999866485596,
"attr": "v"
},
{
"word": "我",
"off": 36,
"len": 3,
"idf": 0,
"attr": "r"
},
{
"word": "面前",
"off": 39,
"len": 6,
"idf": 4.949999809265137,
"attr": "f"
},
{
"word": "我",
"off": 45,
"len": 3,
"idf": 0,
"attr": "r"
},
{
"word": "没有",
"off": 48,
"len": 6,
"idf": 4.650000095367432,
"attr": "v"
},
{
"word": "珍惜",
"off": 54,
"len": 6,
"idf": 4.940000057220459,
"attr": "v"
}
]
}
|