该接口用于向词典中添加新词并更新词语分割模型。 词性说明参考 https://blog.pulipuli.info/2017/11/fasttag-identify-part-of-speech-in.html
请求参数:
参数名 | 类型 | 描述 |
---|---|---|
words | list | 包含要添加到词典中的词的列表。每个词都应该包含一个word、freq、tag字段。 |
请求示例数据:
xxxxxxxxxx
31[
2 {"word":"是一","freq":"5000000","tag":"xxx"}
3]
返回数据:
xxxxxxxxxx
31{
2 "message": "success"
3}
测试curl命令:
xxxxxxxxxx
31curl -X POST -H "Content-Type: application/json" -d '[
2 {"word":"是一","freq":"5000000","tag":"xxx"}
3]' http://112.4.97.79:6080/api/word
该接口用于从词典中删除词并从词语分割模型中删除词。
请求参数:
参数名 | 类型 | 描述 |
---|---|---|
words | list | 包含要从词典中删除的词的列表。每个词都应该包含一个word字段。 |
请求示例数据:
xxxxxxxxxx
31[
2 {"word":"是一"}
3]
返回示例数据:
xxxxxxxxxx
31{
2 "message": "success"
3}
测试curl命令:
xxxxxxxxxx
11curl -X DELETE -H "Content-Type: application/json" -d '[{"word":"测试"}]' http://112.4.97.79:6080/api/word
该接口用于对给定的文本进行词语分割,并将结果以CSV文件的形式返回。
请求参数:
参数名 | 类型 | 描述 |
---|---|---|
text | str | 要进行词语分割的文本。 |
mode | str | full, extract,search 三种模式默认为full |
返回CSV文件。
测试curl命令:
xxxxxxxxxx
11curl 'http://112.4.97.79:6080/api/wordseg?mode=full&text=这是一个测试文本。'
该接口用于获取当前用户词典。
返回示例数据:
xxxxxxxxxx
121{
2 "是一": {
3 "word": "是一",
4 "freq": "5000000",
5 "tag": "xxx"
6 },
7 "是一2": {
8 "word": "是一2",
9 "freq": "5000000",
10 "tag": "xxx"
11 }
12}
测试curl命令:
xxxxxxxxxx
11curl 'http://112.4.97.79:6080/api/userdict'
该接口用于上传文件到服务器。
请求参数:
参数名 | 类型 | 描述 |
---|---|---|
file | file | 要上传的excel文件。 data.xlxs |
返回数据:
csv 文件
xxxxxxxxxx
7120230705,20230705111458X898849990, ,x
220230705,20230705111458X898849990,还,d
320230705,20230705111458X898849990, ,x
420230705,20230705111458X898849990,会,v
520230705,20230705111458X898849990, ,x
620230705,20230705111458X898849990,继续,v
720230705,20230705111458X898849990, ,x
测试curl命令:
xxxxxxxxxx
11curl -X POST -F "file=@data.xlxs" http://112.4.97.79:6080/api/upload