词典管理
创建自定义词典
Chatbot#command("POST", "/clause/customdicts", body)
body / JSON Object
{
"name": "{{customDictName}}",
"type": "vocab"
}
key |
type |
required |
description |
name |
string |
✔ |
自定词典名称,使用小写字母和数据 组成的字符串 |
result/ JSON Object
{
"rc": 0,
"data": {
"name": "{{customDictName}}",
"description": "",
"samples": null,
"createdate": "2019-08-07 19:59:14",
"updatedate": "2019-08-07 19:59:14"
}
}
获取自定义词典列表
Chatbot#command("GET", "/clause/customdicts?limit={{limit}}&page={{page}}")
result/ JSON Object
{
"rc": 0,
"total": 3,
"current_page": 1,
"total_page": 3,
"data": [
{
"name": "{{customDictName}}",
"description": "",
"samples": null,
"createdate": "2019-08-07 19:58:08",
"updatedate": "2019-08-07 19:58:08"
}
]
}
更新自定义词典
Chatbot#command("PUT", "/clause/customdicts/{{customDictName}}", body)
path
key |
type |
default |
description |
customDictName |
string |
无默认值, 必填 |
自定义词典标识 |
body / JSON Object
{
"description": "高级轿车品牌"
}
result/ JSON Object
{
"rc": 0,
"data": {
"name": "pizza",
"description": "",
"samples": null,
"createdate": "2020-07-20 20:52:00",
"updatedate": "2020-07-20 20:51:59",
"type": "vocab",
}
}
删除自定义词典
Chatbot#command("DELETE", "/clause/customdicts/{{customDictName}}")
path
key |
type |
default |
description |
customDictName |
string |
无默认值, 必填 |
自定义词典标识 |
result/ JSON Object
{
"rc": 0,
"msg": "success",
"error": null,
"data": {
"status": {
"needReindex": 2,
"needRetrain": 2
}
}
}