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
Advance a stream
Communications Mining Developer Guide
Last updated Nov 19, 2024
Advance a stream
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/advance
/api/v1/datasets/<project>/<dataset_name>/streams/<stream_name>/advance
Permissions required: Consume streams, View labels.
- Bash
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR" }'
curl -X POST 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR" }' - Node
const request = require("request"); request.post( { url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams/dispute/advance", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { sequence_id: "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR" }, }, 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/advance", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { sequence_id: "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR" }, }, 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/advance", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"}, ) 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/advance", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={"sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR"}, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Response
{ "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR", "status": "ok" }
{ "sequence_id": "qs8QcHIBAADJ1p3W2FtmBB3QiOJsCJlR", "status": "ok" }
Each fetch request returns a
sequence_id
which represents the position it has fetched up to.
Passing that same sequence_id
to the advance api will make sure that
next time a fetch is performed on the stream it will start from this position. You can
advance to the next batch by using the current batch's sequence_id
.
Alternatively, you can advance to the next comment by using the current comment's
sequence_id
.
Since an application can successfully process a comment but fail at the advance step, it is important to handle seeing a comment multiple times on the client application side.
NAME | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
sequence_id | string | yes | The sequence ID to advance the stream to. |