IDEA-CCNL / GTS-Engine

GTS Engine: A powerful NLU Training System。GTS引擎(GTS-Engine)是一款开箱即用且性能强大的自然语言理解引擎,聚焦于小样本任务,能够仅用小样本就能自动化生产NLP模型。
https://gtsfactory.com/
Apache License 2.0
89 stars 9 forks source link

add common api interfaces #1

Closed pskun closed 2 years ago

pskun commented 2 years ago

增加创建任务、上传数据、查看任务状态、列出任务列表、删除任务五个接口: 一、创建任务: 发送请求: curl -X 'POST' \ 'http://192.168.190.2:5207/api/create_task/?task_name=iflytek&task_type=classification' \ -H 'accept: application/json' \ -d '' 返回结果:

{ "ret_code": 200, "message": "task成功创建", "task_id": "iflytek_20221101105310" }

二、上传数据 发送请求 client = GTSEngineClient("192.168.190.2", "5207") client.upload_file(task_id="classification_20221101102810", local_data_path="/cognitive_comp/pankunhao/code/gts_teacher/datasets/GTS测试数据/tnews/labeled_sample.json") 返回结果

{'ret_code': 200, 'message': '上传成功'}

三、查看任务状态 发送请求 curl -X 'POST' \ 'http://192.168.190.2:5207/api/check_task_status?task_id=iflytek_20221101105310' \ -H 'accept: application/json' \ -d '' 返回结果

{ "ret_code": 0, "message": "Initialized" }

四、列出任务列表 发送请求 curl -X 'POST' \ 'http://192.168.190.2:5207/api/list_task/' \ -H 'accept: application/json' \ -d ''

返回结果

{ "ret_code": 200, "message": "Success", "tasks": [ "classification_20221101102810", "classification_20221101102900", "iflytek_20221101105310" ] }

五、删除任务 发送请求 curl -X 'POST' \ 'http://192.168.190.2:5207/api/delete_task/?task_id=classification_20221101102810' \ -H 'accept: application/json' \ -d ''

返回结果

{ "ret_code": 200, "message": "Success" }