Congratulations 🥳 Now that you have received your txnIdyou can start to enable and configure required models.
Different ConfigurableModels can be invoked on the unique txnId using the Speech Analytics APIs. Each model can be independently enabled or disabled depending on the requirement using enableModels. Each model can be configured using modelConfig.
For more information on how to configure each model refer to the Configuring Models section of the documentation.
Prerequisite Information
Metadata can be computed on any Conversation with a Transaction ID txnID
A Transaction ID txnID must be obtained before metadata can be computed.
Depending on the Type of Conversation (audio or video) some of the models will not be available. (Eg. Screengrabs model is only available for video-based Conversations)
Some models are dependent on the output of other models and the dependent models have to be enabled. This dependency can be understood in theFlow of Data and stacking models section.
Each Compute request will generate a requestIdThe progress of the model and its output metadata can be fetched using the requestId . More information on request ID can be obtained from the What is requestId section.
Enable & Configure Models using enableModels andmodelConfig
Each enabled model will be given a unique requestId.
The following are the models that can be enabled using the txnId . Click on each of the Models to learn how to enable and configure it.
To learn more on how to Configure Models goto:
Flow of Data and Stacking Models
In the above diagram, the arrows show the flow of data from one model to another. Some of these models are dependent on the output of previous models. (For Example: Sentiment Analysis model is dependent on the outputs of Speech to Text and Diarization model outputs).
Therefore in the case where Sentiment Analysis has to be enabled the Compute Request API has to be configured to enableModels(Speech to text , Diarization and Sentiment analysis models).Shown below is the sample configuration for the same.
Requests for models can be stacked in the same API call or they can be sent in separate API calls. Shown below are two tabs with examples for the same.
For each Transaction ID txnId, multiple models can be requested to be computed, and for each one of these requests, a unique requestId is created.
Using the requestId the model progress and the model metadata output can be obtained.
States of a Request ID
Example: How to compute only STT and Diarization on a transaction ID?
Step 1: Get the authentication token.
Using your apiKey and apiSecretyou can generate the token as shown below.
curl--location--requestPOST'https://api.marsview.ai/cb/v1/auth/create_access_token' \--header 'Content-Type: application/json' \--data-raw '{ "apiKey": "{{Insert API Key}}", "apiSecret": "{{Insert API Secret}}", "userId": "demo@marsview.ai"}'
import requestsuserId ='Paste the user ID here'apiKey ='Paste the API key here'apiSecret ='Paste the API secret here'defget_token(): url ="https://api.marsview.ai/cb/v1/auth/get_access_token" payload={"apiKey":apiKey,"apiSecret":apiSecret,"userId":userId} headers ={'Content-Type':'application/json'} response = requests.request("POST", url, headers=headers, json=payload)print(response.text)if__name__=="__main__":get_token()
Marsview Automatic Speech Recognition (ASR) technology accurately converts speech into text in live or batch mode. API can be deployed in the cloud or on-premise. Get superior accuracy, speaker separation, punctuation, casing, word-level time markers, and more. (Supported Language: English)