# Classification

You can use this node when your agent’s response is dependent on the user input. This node is similar to "**Conditions**", however, here we classify into intents.&#x20;

![](https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L_81A0PNZfdawu_TPAO%2F-Mb1hoas81DaA6cfWhk9%2F-Mb1iCVCl57XZ0wIBrYS%2FScreen%20Shot%202021-05-31%20at%2016.59.10.png?alt=media\&token=db2f83af-0de6-48c2-9fc0-023af6e22722)

In most cases, it will be the “**Classification**” node that follows “**Collect Input**”. Once you collect an input, it needs to be classified into the right intent. Click on the module and choose the parameter (the one you used in “**Collect Input**”) and the intent/s relevant for the classification.&#x20;

“**Missed**” - This tab will be triggered if the agent is unable to classify the user input. You can define the default behavior by connecting “**Missed**” to any other node.

### Add Intents to the Classification node

The intent section is where you will **create the knowledge and training** for your agent, which later will be used to classify the user's intent. &#x20;

You can either add from the predefined [<mark style="color:purple;">system intents</mark>](https://studio.docs.ai.vonage.com/properties-1/intents/system-intents), or create your own intents on the spot.

Each intent will encompass one use case, e.g. "I want to change my password" will be one intent, and "My access got revoked" could be another. Your agent will use this list of utterances to **classify user inputs**. Every example you will enter should represent a sentence callers may use to attain a specific answer or action.&#x20;

Add as many examples as possible to make sure your agent is trained and able to understand the different ways people are referring to one query.

{% hint style="info" %}
*You can add as many intents based on your use cases as needed.*

***More information on intents*** [*<mark style="color:purple;">**here**</mark>*](https://studio.docs.ai.vonage.com/intents)***.***
{% endhint %}

## Train & Test

Aside from the Tester, you can test your agent's accuracy with the **"Train & Test" Feature**.&#x20;

Enter a user query you want to test and the feature will return the intent(s) it would classify the phrase into.&#x20;

The test query does not need to already be part of the user expressions in the intent, feel free to choose new phrases. You can add any test sentence you tried matching it with an intent to the training set by clicking the "+" sign on the side.

The probability percentage shows you how accurately this phrase would be classified into an intent. &#x20;

{% hint style="info" %}
*Don't get discouraged if the correct intent doesn't show 100% probability. It might show a few intents that get a very small percentage of probability as well. All intents the agent finds relevant for this query will get 100% probability together.*&#x20;

*For very ambiguous intents, the probability might be below 70% and show yellow. You might want to have a look here at* [*<mark style="color:purple;">how to improve your training set</mark>*](https://studio.docs.ai.vonage.com/intents) *or* [*<mark style="color:purple;">deal with ambiguous intents</mark>*](https://studio.docs.ai.vonage.com/actions/basic/classification/intent-ambiguity)*.*&#x20;
{% endhint %}

![](https://3877181490-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_81A0PNZfdawu_TPAO%2Fuploads%2FCQBbaqMbZ8kWzWt9P1HN%2FTrain%20and%20Test.gif?alt=media\&token=39ccd855-e087-48d1-bad4-68d6d5421aa9)

{% hint style="info" %}
*In case, the AI cannot match your query to any intent, it will give the intent "**sys.default**" as the highest score. Sys.default means that if tested, this query would go to the **Missed** tab.*
{% endhint %}

{% hint style="info" %}
*Large classification nodes with a vast number of intents tends to lead to ambiguity between intents and therefore lots of misclassifications. Use the hierarchical system to classify when you have a large number of intents.*&#x20;

*Here's how to do it:-*&#x20;

*In the first classification node include all the general intents, after that add another classification node to further classify the action or sub intent related to that intent.*

*For example, the first node includes the general intents of Reservations and Facilities. In the next adjoining classifications node will include intents for change reservation, new reservation, cancel reservation connected to Reservations in the first node and gym, pool, club attached to Facilities from the first node.*&#x20;

*Use classification node only when the entity type is sys.any, for other entity types, use the condition node.*
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://studio.docs.ai.vonage.com/voice/nodes/basic/classification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
