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.
post
https://api.marsview.ai/cb/v1/profile/intents/create_intent
Creates a new intent and responds with the new intentId in the database
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" : "[email protected]",
"intentName" : "Demo Intent",
"intentSamples" : ["This is an intent sample", "These samples are used of intent recognition"],
"intentSamplePhrases" : ["intent phrase", "phrase sample"]
}'
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
https://api.marsview.ai/cb/v1/profile/intents/get_user_intents
Responds with all the intent data and from the database
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>'
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": "[email protected]",
"intent_id": "intent-bxllq7f8vkxgv7vmk-1640136993500",
"intent_name": "sample name",
"implements": [],
"intent_samples": [],
"intent_sample_phrases": [
"intent sample",
"sample intent"
],
"deleted": false
}
]
}
}
delete
https://api.marsview.ai/cb/v1/profile/intents/delete_intent
Deletes an existing intent and responds with the deleted intentId from the database
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>'
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"
}
}