POST Compute Request

Congratulations 🥳 Now that you have received your txnId you can start to enable and configure required models.

Different Configurable Models 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 the Flow 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

Using txnId you can now select models usingenableModels and Configure Models using modelConfig and submit a request using POST Compute Request.

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.

"enableModels":[
    {
        "modelType":"speech_to_text",
        "modelConfig": {
            "speaker_seperation":{
                "num_speakers":2
            }
        }
    },
    {
        "modelType":"sentiment_analysis",
    }
]

Stacking of requests

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.

----------------------> API CALL #1

"enableModels":[
    {
        "type":"speech_to_text",
    },
    {
        "type":"sentiment_analysis",
    },
    {
        "type":"emotion_analysis",
    }
]

Note that when you are sending in Separate API Calls on the same txnId, Requests from previous API Calls must be in "completed" or "error" state

Compute Request

POST https://api.marsview.ai/cb/v1/conversation/compute

Headers

Request Body

{
    "status": true,
    "data": {
        "requestId": [
            {
                "type": "speech_to_text",
                "requestId": "req-1c6q6fnvkq6vp1gl-1624295656100"
            },
            {
                "type": "emotion_analysis",
                "requestId": "req-1c6q6fnvkq6vp1gm-1624295656100"
            },
            {
                "type": "sentiment_analysis",
                "requestId": "req-1c6q6fnvkq6vp1gn-1624295656100"
            },
            {
                "type": "speech_type_analysis",
                "requestId": "req-1c6q6fnvkq6vp1go-1624295656100"
            },
            {
                "type": "action_items",
                "requestId": "req-1c6q6fnvkq6vp1gp-1624295656100"
            },
            {
                "type": "question_response",
                "requestId": "req-1c6q6fnvkq6vp1gq-1624295656100"
            },
            {
                "type": "extractive_summary",
                "requestId": "req-1c6q6fnvkq6vp1gr-1624295656100"
            },
            {
                "type": "meeting_topics",
                "requestId": "req-1c6q6fnvkq6vp1gs-1624295656100"
            },
            {
                "type": "screengrabs",
                "requestId": "req-1c6q6fnvkq6vp1gt-1624295656100"
            },
            {
                "type": "screen_activity",
                "requestId": "req-1c6q6fnvkq6vp1gu-1624295656100"
            }
        ]
    }
}

What is a requestId?

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 --request POST '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"
}'

Step 2: Send a Compute Request

curl --location --request POST 'https://api.marsview.ai/cb/v1/conversation/compute' \
--header 'Content-Type: application/json' \
--header 'authorization: <Your access token>' \
--data-raw '{
    "txnId": "your txn id",
    "enableModels":[
        {
        "modelType":"speech_to_text",
        "modelConfig":{
            "custom_vocabulary":["Marsview", "Communication"],
            "speaker_seperation":{
                "num_speakers":2
            },
            "topics":true
            }
        }
    ]
}'

Example Response for POST Compute Request

{
    "status": true,
    "data": {
        "requestId": [
            {
                "type": "speech_to_text",
                "requestId": "req-1c6q6f7dkq1y6lm0-1623997503719"
            },
            {
                "type": "emotion_analysis",
                "requestId": "req-1c6q6f7dkq1y6lm1-1623997503719"
            },
            {
                "type": "sentiment_analysis",
                "requestId": "req-1c6q6f7dkq1y6lm2-1623997503719"
            },
            {
                "type": "speech_type_analysis",
                "requestId": "req-1c6q6f7dkq1y6lm3-1623997503719"
            },
            {
                "type": "action_items",
                "requestId": "req-1c6q6f7dkq1y6lm4-1623997503719"
            },
            {
                "type": "question_response",
                "requestId": "req-1c6q6f7dkq1y6lm5-1623997503719"
            },
            {
                "type": "extractive_summary",
                "requestId": "req-1c6q6f7dkq1y6lm6-1623997503719"
            },
            {
                "type": "meeting_topics",
                "requestId": "req-1c6q6f7dkq1y6lm7-1623997503719"
            },
            {
                "type": "screengrabs",
                "requestId": "req-1c6q6f7dkq1y6lm8-1623997503719"
            },
            {
                "type": "screen_activity",
                "requestId": "req-1c6q6f7dkq1y6lm9-1623997503719"
            }
        ]
    }
}

Last updated