Text Intent Recognition

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

API Request

Returns the predicted intent for a given phrases / sentences

POST https://api.marsview.ai/text/intent/get_intent

Query Parameters

NameTypeDescription

jwtToken*

String

Marsview api access token. You can generate it here: https://docs.marsview.ai/speech-analytics-api/authentication

sentences*

List

The sentences you want to match intents for

userId*

String

Your Email or User ID

threshold

Float

The confidence threshold for intent matching. If not specified defaults to 0.5

intentIds*

List

List of intent ids to match the sentences against

{
  "status": true,
  "error": {},
  "data": {
    {
    "similarityMatch": [
        {
          "matchedTextList": [
            {
              "score": 0.6180883955955505,
              "text": "Marsview is a great place to work",
              "value": "Marsview"
            }
          ],
          "intentId": "intent-bxllq2f7hpkrvtyzi3-1627981197627",
          "intentName": "Marsview"
        },
      ],
    }
  },
  "userId": "chandra.sekhar@marsview.ai"
}

Example Curl Request

Shown below is a code snippet to send a sample request for intent recognition

curl --location --request POST 'https://api.marsview.ai/text/intent/get_intent' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jwtToken" : "Insert JWT token Key",
    "threshold": "Insert a desired confidence threshold",
    "intentIds": "Insert a list of intent IDs", 
    "sentences": "Insert your sentence for intent recognition",
    "userId"   : "demo@marsview.ai"
}'

Example Response

Shown below is a sample JSON response from the above request.

{
  "status": true,
  "error": {},
  "data": {
    {
    "similarityMatch": [
        {
          "matchedTextList": [
            {
              "score": 0.6180883955955505,
              "text": "Marsview is a great place to work",
              "value": "Marsview"
            }
          ],
          "intentId": "intent-bxllq2f7hpkrvtyzi3-1627981197627",
          "intentName": "Marsview"
        },
      ],
    }
  },
  "userId": "chandra.sekhar@marsview.ai"
}

Response Object

FieldDescription

similarityMatch

The intent similarity output from the models

intentId

The intent Id against which the sentences are matched

intentName

The name of the matching intent

score

The similarity matching score ranges from 0 to 1

text

The sentence which is used to predict intent for

value

The predicted intent

Last updated