Questions & Responses
Enable this model configuration to detect all the questions and responses from the conversation
Automatically identify and detect questions or requests posed during the conversation and also the apt response in the conversation in a consumable form.
The API automatically detects the Question and Response by the speaker.

Keys | Value |
modelType | question_response |
modelConfig | Model Configuration object for question_response (No configurations) |
Keys | Allowed values | Default |
quality | 0,1, 2(Check question quality values for usage) | 1 |
Quality Value | Description |
0 | Detect only well defined questions. |
1 | Detect well defined and reasonably well defined questions |
2 | Detect well defined, reasonably well defined and small talk based questions |
Curl
Python
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":"speech_type_analysis"
},
{
"modelType":"question_response"
"modelConfig":{
"quality" : 1
}
}
]
}'
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_question_and_response():
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":"speech_type_analysis"
},
{
"modelType":"question_response"
},
]
}
headers = {'authorization': '{}'.format(auth_token)}
response = requests.request("POST", request_url.format(user_id=user_id), 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_question_and_response()
"data": {
"questionResponse": [
{
"questionStartTime": 74840,
"questionEndTime": 76010,
"responseEndTime": "91389.999",
"questionBlock": [
{
"question": "Why should we choose you?",
"startTime": 74840,
"endTime": 76010
}
],
"response": "well, I'll probably myself on my work ethic. I am willing and capable of working long hours to complete the tasks. I have experience in this field and I am continuing my education so further my status.",
"questionConfidence": "1.0",
"responseConfidence": "0.7773251640550028",
"source": "ai_generated",
"speaker": "unknown"
},
]
}
Field | Description |
questionResponse | List of question response objects which occured together. |
questionStartTime | Start time of the question in milliseconds. |
questionEndTime | End time of the question in milliseconds. |
responseEndTIme | End time of the response in milliseconds. |
questionBlock | List of questions identified in the given time frame. |
question | Question identified in the given time frame. |
startTime | Start time of the identified question in the given time frame. |
endTime | End time of the identified question in the given time frame. |
response | Response given to the question identified in the time frame. |
questionConfidence | Model's confidence in the identified question block. |
responseConfidence | Model's confidence in the identified response . |
source | |
speaker | Id of the speaker whose voice is identified in the given time frame. (Will return a String "unknown" if the speaker could not be identified or speaker separation is set to -1(disabled). |
Last modified 2yr ago