Custom Statement Tags

Custom statement tag classification is the task of classifying an utterance with respect to the function it serves in a dialogue, i.e. the act the speaker is performing. These tags can be configured to detect custom intents by giving example statements.

API Request

Returns the predicted statement tags for a given phrases / sentences

POST https://api.marsview.ai/text/custom_statement_tags/get_custom_statement_tag

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 statements tags for

userId*

String

Your Email or User ID

threshold

Float

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

statementTagIds

List

List of statement tag ids to match the sentences against. If not given matched against all the statement tags of the user

{
  "status": true,
  "error" : {},
  "data"  : {
    "similarityMatch": [
      {
        "statementTagId": "statement-bxllq1zsuzkvuj44go-1636609624728",
        "statementTagName": "compliance-quality-check"
        "matchedTextList": [
          {
            "score": 0.6180883955955505,
            "text": "This call is going to be recorded for quality purposes.",
            "value": "This call will be recorded"
          }
        ],
      }
    ]
  },
  "userId": "chandra.sekhar@marsview.ai"
}

Example Curl Request

Shown below is a code snippet to send a sample request for custom statement tag detection

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

Example Response

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

{
  "status": true,
  "error" : {},
  "data"  : {
    "similarityMatch": [
      {
        "statementTagId": "statement-bxllq1zsuzkvuj44go-1636609624728",
        "statementTagName": "compliance-quality-check"
        "matchedTextList": [
          {
            "score": 0.6180883955955505,
            "text": "This call is going to be recorded for quality purposes.",
            "value": "This call will be recorded"
          }
        ],
      }
    ]
  },
  "userId": "chandra.sekhar@marsview.ai"
}

Response Object

FieldDescription

similarityMatch

The statement tag similarity identified by the models

statementTagId

The statement tag Id against which the sentences are matched

statementTagName

The name of the matching statement tag

score

The similarity matching score ranges from 0 to 1

text

The sentence which is used to predict statement tag for

value

The predicted statement tag

Last updated