Comment on page
Summary
Enable this model configuration to get the extractive summary of the video/audio.
This model extracts the key sentences used in the video/audio and summarizes them .
Keys | Value |
modelType | extractive_summary |
modelConfig | Model Configuration object for extractive_summary(No configurations) |
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":"extractive_summary"
}
]
}'
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_extractive_summary():
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":"extractive_summary"
},
]
}
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_extractive_summary()
"data": {
"summaryData": [
{
"sentence": "I will start by asking a few questions and then give you an opportunity to ask any questions you may have at the end.",
"startTime": 6600,
"endTime": 12950,
"speaker": "1"
},
]
}
Field | Description |
summaryData | List of key sentences identified in the Video/Audio |
sentence | A sentence identified by the model in the given time frame. |
startTime | Start time of the sentence in the input Video/Audio in milliseconds. |
endTime | End time of the sentence in the input Video/Audio in milliseconds. |
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