Machine Learning is the tool that allows your agent to understand a user's interactions as natural language and convert them into structured data. In Dialogflow terminology, your agent uses machine learning algorithms to match user requests to specific intents and uses entities to extract relevant data from them.
An agent “learns” both from the examples you provide in the Training Phrases section and the language models developed by Dialogflow. Based on this data, it builds a model (algorithm) for making decisions on which intent should be triggered by a user input and what data needs to be extracted. This algorithm is unique to your agent.
The algorithm adjusts dynamically according to the changes made in your agent and in the Dialogflow platform. To make sure that the algorithm is improving, your agent needs to constantly be trained using real conversation logs.
The machine learning algorithm for your agent is updated every time you save changes in intents and entities, approve changes in Training, or import/restore an agent from a zip file.
Machine Learning On/Off
You can turn off machine learning for individual intents by clicking on the options icon more_vert in the upper right hand corner and choose Disable ML.
When Machine learning is off, the intent will be triggered only if there is an exact match between the user’s input and one of the examples provided in the Training Phrases section of the intent.
To configure the setting when creating intents via /intents endpoint, use
"auto": true for enabling machine learning or
"auto": false for disabling machine learning in the intent object.
Match Mode is used for matching user requests to specific intents and uses entities to extract relevant data from them. To do this, click on the gear icon settings for your agent, then ML Settings and choose one of the following options from the drop down menu, under Match Mode.
- Hybrid (Rule-based and ML) - Is best for agents with a small number of examples in intents and/or wide use of templates syntax and composite entities.
- ML only - Can be used for agents with a large number of examples in intents, especially the ones using
@sys.anyor very large developer entities.
ML Classification Threshold
To filter out false positive results and still get variety in matched natural language inputs for your agent, you can tune the machine learning classification threshold. If the returned
"score" value in the JSON response to a query is less than the threshold value, then a fallback intent will be triggered or, if there are no fallback intents defined, no intent will be triggered.
To modify this setting, click on the gear icon settings for your agent, then ML Settings and type in a new threshold value for ML Classification Threshold. Click the Save button and then Train to retrain your agent ML model.