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
Update a stream
Communications Mining Developer Guide
Last updated Oct 3, 2024
Update a stream
/api/v1/datasets/<project>/<dataset_name>/streams
/api/v1/datasets/<project>/<dataset_name>/streams
- Bash
curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "stream": { "comment_filter": { "user_properties": { "number:Spend": { "maximum": 100000, "minimum": 100 }, "number:Transactions": { "one_of": [ 1 ] }, "string:Country": { "one_of": [ "uk", "de" ] } } }, "description": "Used by ACME RPA to create tickets for disputes.", "model": { "label_thresholds": [ { "name": [ "Some Label" ], "threshold": 0.37 }, { "name": [ "Another Label" ], "threshold": 0.46 }, { "name": [ "Parent Label", "Child Label" ], "threshold": 0.41 } ], "version": 8 }, "name": "dispute", "title": "Collateral Disputes" } }'
curl -X PUT 'https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams' \ -H "Authorization: Bearer $REINFER_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "stream": { "comment_filter": { "user_properties": { "number:Spend": { "maximum": 100000, "minimum": 100 }, "number:Transactions": { "one_of": [ 1 ] }, "string:Country": { "one_of": [ "uk", "de" ] } } }, "description": "Used by ACME RPA to create tickets for disputes.", "model": { "label_thresholds": [ { "name": [ "Some Label" ], "threshold": 0.37 }, { "name": [ "Another Label" ], "threshold": 0.46 }, { "name": [ "Parent Label", "Child Label" ], "threshold": 0.41 } ], "version": 8 }, "name": "dispute", "title": "Collateral Disputes" } }' - Node
const request = require("request"); request.put( { url: "https://<my_api_endpoint>/api/v1/datasets/project1/collateral/streams", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { stream: { comment_filter: { user_properties: { "number:Spend": { maximum: 100000, minimum: 100 }, "number:Transactions": { one_of: [1] }, "string:Country": { one_of: ["uk", "de"] }, }, }, description: "Used by ACME RPA to create tickets for disputes.", model: { label_thresholds: [ { name: ["Some Label"], threshold: 0.37 }, { name: ["Another Label"], threshold: 0.46 }, { name: ["Parent Label", "Child Label"], threshold: 0.41 }, ], version: 8, }, name: "dispute", title: "Collateral Disputes", }, }, }, 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", headers: { Authorization: "Bearer " + process.env.REINFER_TOKEN, }, json: true, body: { stream: { comment_filter: { user_properties: { "number:Spend": { maximum: 100000, minimum: 100 }, "number:Transactions": { one_of: [1] }, "string:Country": { one_of: ["uk", "de"] }, }, }, description: "Used by ACME RPA to create tickets for disputes.", model: { label_thresholds: [ { name: ["Some Label"], threshold: 0.37 }, { name: ["Another Label"], threshold: 0.46 }, { name: ["Parent Label", "Child Label"], threshold: 0.41 }, ], version: 8, }, name: "dispute", title: "Collateral Disputes", }, }, }, 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", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "stream": { "name": "dispute", "title": "Collateral Disputes", "description": "Used by ACME RPA to create tickets for disputes.", "model": { "version": 8, "label_thresholds": [ {"name": ["Some Label"], "threshold": 0.37}, {"name": ["Another Label"], "threshold": 0.46}, { "name": ["Parent Label", "Child Label"], "threshold": 0.41, }, ], }, "comment_filter": { "user_properties": { "string:Country": {"one_of": ["uk", "de"]}, "number:Spend": {"minimum": 100, "maximum": 100000}, "number:Transactions": {"one_of": [1]}, } }, } }, ) 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", headers={"Authorization": "Bearer " + os.environ["REINFER_TOKEN"]}, json={ "stream": { "name": "dispute", "title": "Collateral Disputes", "description": "Used by ACME RPA to create tickets for disputes.", "model": { "version": 8, "label_thresholds": [ {"name": ["Some Label"], "threshold": 0.37}, {"name": ["Another Label"], "threshold": 0.46}, { "name": ["Parent Label", "Child Label"], "threshold": 0.41, }, ], }, "comment_filter": { "user_properties": { "string:Country": {"one_of": ["uk", "de"]}, "number:Spend": {"minimum": 100, "maximum": 100000}, "number:Transactions": {"one_of": [1]}, } }, } }, ) print(json.dumps(response.json(), indent=2, sort_keys=True)) - Response
{ "status": "ok", "stream": { "context": "0", "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" } }
{ "status": "ok", "stream": { "context": "0", "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" } }