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
Reset a stream
Communications Mining Developer Guide
Last updated Oct 3, 2024
Reset a stream
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/reset
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/reset
Permissions required: Consume streams, View labels.
- Bash
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "to_comment_created_at": "2020-06-03T16:05:00" }'
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "to_comment_created_at": "2020-06-03T16:05:00" }' - Node
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { to_comment_created_at: "2020-06-03T16:05:00" }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } );
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { to_comment_created_at: "2020-06-03T16:05:00" }, }, function (error, response, json) { // digest response console.log(JSON.stringify(json, null, 2)); } ); - Python
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"to_comment_created_at": "2020-06-03T16:05:00"}, ) print(json.dumps(response.json(), indent=2, sort_keys=True))
import json import os import requests response = requests.post( "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/reset", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"to_comment_created_at": "2020-06-03T16:05:00"}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Response
{ "sequence_id": "4LvtenIBAAA=", "status": "ok", "stream": { "created_at": "2019-08-03T12:30:00.123456Z", "dataset_id": "abcdef0123456789", "description": "Used by ACME RPA to create tickets for disputes.", "id": "0123456789abcdef", "model": { "version": 8 }, "name": "dispute", "title": "Collateral Disputes", "updated_at": "2019-08-03T12:30:00.123456Z" } }
{ "sequence_id": "4LvtenIBAAA=", "status": "ok", "stream": { "created_at": "2019-08-03T12:30:00.123456Z", "dataset_id": "abcdef0123456789", "description": "Used by ACME RPA to create tickets for disputes.", "id": "0123456789abcdef", "model": { "version": 8 }, "name": "dispute", "title": "Collateral Disputes", "updated_at": "2019-08-03T12:30:00.123456Z" } }
A stream can be reset to move its position backwards or forwards in time, either to
repeat previously returned comments or to skip comments. The timestamp used to reset a
stream refers to the time the comments were uploaded (i.e. the comment's
created_at
property, rather than its timestamp
property).
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
to_comment_created_at | string | yes | A ISO-8601 timestamp. |
The response will contain the
sequence_id
corresponding to the new
stream position.