communications-mining
latest
false
- API docs
- CLI
- Integration guides
- Blog
- How machines learn to understand words: a guide to embeddings in NLP
- Prompt-based learning with Transformers
- Efficient Transformers II: knowledge distillation & fine-tuning
- Efficient Transformers I: attention mechanisms
- Deep hierarchical unsupervised intent modelling: getting value without training data
- Fixing annotating bias with Communications Mining
- Active learning: better ML models in less time
- It's all in the numbers - assessing model performance with metrics
- Why model validation is important
- Comparing Communications Mining and Google AutoML for conversational data intelligence
Tag an exception
Communications Mining Developer Guide
Last updated Dec 20, 2024
Tag an exception
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/exceptions
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/exceptions
- Bash
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" } ] }' - Node
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)) - Response
{ "status": "ok" }
{ "status": "ok" }
This endpoint allows you to tag comments as exceptions in the platform, so that a model trainer can review and label them in order to improve the model. We recommend to tag the comments for which the model returned no predictions, and comments for which the model returned wrong predictions. (For help with designing the exception handling flow, please check the Integration Guide).
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
exceptions | array<Exception> | yes | A list of exceptions. |
Where
Exception
has the following format:
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
uid | string | yes | The uid of the comment that should be tagged as
exception.
|
metadata | Metadata | yes | An object containing exception metadata. |
Where
Metadata
has the following format:
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
type | string | yes | The exception type will be available as a filter property in the Communications Mining UI. The value can be an arbitrary string. Please choose a short, easy-to-understand string such as "No Prediction" and "Wrong Prediction". |