communications-mining
latest
false
- API 文档
- CLI
- 集成指南
- 博客
重要 :
请注意,此内容已使用机器翻译进行了本地化。
Communications Mining 开发者指南
上次更新日期 2024年12月20日
标记异常
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/exceptions
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/exceptions
- 重击
curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/exceptions' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "exceptions": [ { "metadata": { "type": "No Prediction" }, "uid": "18ba5ce699f8da1f.abcdef0123456789" }, { "metadata": { "type": "Wrong Prediction" }, "uid": "18ba5ce699f8da1f.0123456789abcdef" } ] }'
curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/exceptions' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "exceptions": [ { "metadata": { "type": "No Prediction" }, "uid": "18ba5ce699f8da1f.abcdef0123456789" }, { "metadata": { "type": "Wrong Prediction" }, "uid": "18ba5ce699f8da1f.0123456789abcdef" } ] }' - 节点
const request = require("request"); request.put( { url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/exceptions", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { exceptions: [ { metadata: { type: "No Prediction" }, uid: "18ba5ce699f8da1f.abcdef0123456789", }, { metadata: { type: "Wrong Prediction" }, uid: "18ba5ce699f8da1f.0123456789abcdef", }, ], }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.put( { url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/exceptions", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { exceptions: [ { metadata: { type: "No Prediction" }, uid: "18ba5ce699f8da1f.abcdef0123456789", }, { metadata: { type: "Wrong Prediction" }, uid: "18ba5ce699f8da1f.0123456789abcdef", }, ], }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.put( "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/exceptions", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "exceptions": [ { "uid": "18ba5ce699f8da1f.abcdef0123456789", "metadata": {"type": "No Prediction"}, }, { "uid": "18ba5ce699f8da1f.0123456789abcdef", "metadata": {"type": "Wrong Prediction"}, }, ] }, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.put( "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/exceptions", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "exceptions": [ { "uid": "18ba5ce699f8da1f.abcdef0123456789", "metadata": {"type": "No Prediction"}, }, { "uid": "18ba5ce699f8da1f.0123456789abcdef", "metadata": {"type": "Wrong Prediction"}, }, ] }, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - 响应
{ "status": "ok" }
{ "status": "ok" }
此端点允许您在平台中将注释标记为异常,以便模型训练器可以查看注释并为其加上标签,以改进模型。 我们建议标记模型未返回预测的注释,以及模型返回错误预测的注释。 (有关设计异常处理流程的帮助,请查看集成指南)。
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
exceptions | array<Exception> | 是 | 异常列表。 |
其中
Exception
具有以下格式:
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
uid | 字符串 | 是 | 应标记为异常的注释的uid 。
|
metadata | 元数据 | 是 | 包含异常元数据的对象。 |
其中
Metadata
具有以下格式:
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
type | 字符串 | 是 | 异常类型将在 Communications Mining 用户界面中用作筛选器属性。 该值可以是任意字符串。 请选择一个简短易懂的字符串,例如“无预测”和“预测错误”。 |