Statement Tags
Statement tag classification is the task of classifying an utterance with respect to the function it serves in a dialogue, i.e. the act the speaker is performing. These tags can be configured to detect custom intents by giving example statements.
modelType
Configuration
modelType
ConfigurationExample Request
curl --location --request POST 'https://api.marsview.ai/cb/v1/conversation/compute' \
--header 'Content-Type: application/json' \
--header "Authorization: {{Insert Auth Token}}" \
--data-raw '{
"txnId": "{{Insert txn ID}}",
"enableModels":[
{
"modelType":"speech_to_text",
"modelConfig":{
"automatic_punctuation" : true,
"custom_vocabulary":["Marsview", "Communication"],
"speaker_seperation":{
"num_speakers":2
},
"enableKeywords":true,
"enableTopics":false
}
},
{
"modelType": "statement_tag_analysis",
"modelConfig": {
"config": {
"statements": [
"statement-1c6q62hzkxim6ect-1640242740269",
"statement-1c6q62hzkxim9q8o-1640242895640"
]
}
}
}
]
}'
import requests
auth_token = "replace this with your auth token"
txn_id = "Replace this with your txn id"
request_url = "https://api.marsview.ai/cb/v1/conversation/compute"
def get_statement_tags():
payload={
"txnId": txn_id,
"enableModels":[
{
"modelType":"speech_to_text",
"modelConfig":{
"automatic_punctuation" : True,
"custom_vocabulary":["Marsview", "Communication"],
"speaker_seperation":{
"num_speakers":2
},
"enableKeywords":True,
"enableTopics":False
}
},
{
"modelType": "statement_tag_analysis",
"modelConfig": {
"config": {
"statements": [
"statement-1c6q62hzkxim6ect-1640242740269",
"statement-1c6q62hzkxim9q8o-1640242895640"
]
}
}
}
]
}
headers = {'authorization': '{}'.format(auth_token)}
response = requests.request("POST", headers=headers, json=payload)
print(response.text)
if response.status_code == 200 and response.json()["status"] == "true":
return response.json()["data"]["enableModels"]["state"]["status"]
else:
raise Exception("Custom exception")
if __name__ == "__main__":
get_statement_tags()
Example Response
"data": {
"sentiment": [
{
"startTime": 1390,
"endTime": 2690,
"speakers": [
"1"
],
"similarityMatch": [
{
"statementTagId": "statement-bxllq1zsuzkvuj44go-1636609624728",
"statementTagName": "compliance-quality-check"
"matchedTextList": [
{
"score": 0.6180883955955505,
"text": "This call is going to be recorded for quality purposes.",
"value": "This call will be recorded"
}
],
}
],
"sentence": "This call is going to be recorded for quality purposes."
},
]
}
Response Object
Last updated