Intent Recognition

The Intent Analysis model will help you capture semantics behind user's messages and assign it to the right label. It is designed to understand human conversation in the form or free text or spoken

Marsview offers intent recognition for text, speech in async and real-time.

Text intent recognition Learn more

Intent recognition in real-time speech analytics Learn more

Intent recognition in async speech analytics Learn more

Creation of Intents

API Request

Creates a new intent and responds with the new intentId in the database

POST https://api.marsview.ai/cb/v1/profile/intents/create_intent

Creates

Query Parameters

Headers

Request Body

{
    "status": true,
    "data": {
        "intentId": "intent-bxllq7f8vkxgv7vmk-1640136993500"
    }
}

Example Curl Request

Shown below is a code snippet to create a new intent

curl --location --request POST 'https://api.marsview.ai/cb/v1/profile/intents/create_intent/<userId>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT access token>' \
--data-raw '{
    "userId"                : "demo@marsview.ai",
    "intentName"            : "Demo Intent", 
    "intentSamples"         : ["This is an intent sample", "These samples are used of intent recognition"],
    "intentSamplePhrases"   : ["intent phrase", "phrase sample"]
}'

Example Response

The intent is created if the server responds with a 200 status code and the status is set to True in the JSON response

{
    "status": true,
    "data": {
        "intentId": "intent-bxllq7f8vkxgv7vmk-1640136993500"
    }
}

Get User Intents

API Request

Responds with all the intent data and from the database

GET https://api.marsview.ai/cb/v1/profile/intents/get_user_intents

Creates

Query Parameters

Headers

{
    "status": true,
    "data": {
        [
            {
                "_id": "61c28121c3201048f422b612",
                "type": "custom",
                "user_id": "chandra.sekhar@marsview.ai",
                "intent_id": "intent-bxllq7f8vkxgv7vmk-1640136993500",
                "intent_name": "sample name",
                "implements": [],
                "intent_samples": [],
                "intent_sample_phrases": [
                    "intent sample",
                    "sample intent"
                ],
                "deleted": false
            }
        ]
    }
}

Example Curl Request

Shown below is a code snippet to fetch all the intents of a user

curl --location --request GET 'https://api.marsview.ai/cb/v1/profile/intents/get_user_intents/<userId>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT access token>' 

Example Response

The intents are fetched and returned if the server responds with a 200 status code and the status is set to True in the JSON response

{
    "status": true,
    "data": {
        [
            {
                "_id": "61c28121c3201048f422b612",
                "type": "custom",
                "user_id": "chandra.sekhar@marsview.ai",
                "intent_id": "intent-bxllq7f8vkxgv7vmk-1640136993500",
                "intent_name": "sample name",
                "implements": [],
                "intent_samples": [],
                "intent_sample_phrases": [
                    "intent sample",
                    "sample intent"
                ],
                "deleted": false
            }
        ]
    }
}

Deletion of Intents

API Request

Deletes an existing intent and responds with the deleted intentId from the database

DELETE https://api.marsview.ai/cb/v1/profile/intents/delete_intent

Creates

Query Parameters

Headers

{
    "status": true,
    "data": {
        "msg": "Intent Deleted successfully",
        "intentId": "intent-bxllq7f8vkxgv8jhu-1640137024434"
    }
}

Example Curl Request

Shown below is a code snippet to delete an existing intent

curl --location --request DELETE 'https://api.marsview.ai/cb/v1/profile/intents/create_intent/<userId>/<intentId>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <JWT access token>' 

Example Response

The intent is deleted if the server responds with a 200 status code and the status is set to True in the JSON response

{
    "status": true,
    "data": {
        "msg": "Intent Deleted successfully",
        "intentId": "intent-bxllq7f8vkxgv8jhu-1640137024434"
    }
}

Last updated