Dialogflow agents use machine learning algorithms to understand natural language utterances, match them to intents, and extract structured data.
An agent learns both from training phrases that you provide and the language models built into Dialogflow. Based on this data, it builds an algorithm for making decisions about which intent should be matched to a user utterance. This algorithm is unique to your agent.
Dialogflow updates your agent's machine learning algorithm every time you make changes to intents and entities, import or restore an agent, or train your agent.
Machine learning settings are in the agent's settings (the gear icon settings next to the agent's name) under the ML Settings tab.
This setting defines the algorithms that should be used for all intents in which machine learning is enabled. You can select one of the two following modes:
- Hybrid (suggested): This mode first attempts a rule-based grammar match. If a match is not made, it switches to ML matching.
- ML Only: This mode uses only ML matching.
ML classification threshold
To filter out false positive results and still get variety in matched inputs for your agent, you can tune the machine learning classification threshold.
Intent matches have a confidence value that ranges from
0.0 (completely uncertain) to
1.0 (completely certain). If the confidence value is less than the ML classification threshold, a Fallback Intent is matched.
Automatic spell correction
If automatic spell correction is enabled and user input has a spelling or grammar mistake, an intent will be matched as though it was written correctly. The detect intent response will contain the corrected user input. For example, if a user enters "I want an aple", it will be processed as though the user entered "I want an apple". This also applies to matches involving both system and developer entities.
Spell correction is available for all languages supported by Dialogflow.
Warnings and best practices:
- Spell correction can't correct ASR (automatic speech recognition) errors, so we don't recommend enabling it for agents using ASR inputs.
- It is possible for corrected input to match the wrong intent. You can fix this by adding commonly mismatched phrases to negative examples.
- Spell correction increases the agent's response time slightly.
- Spell correction is trained on general user queries. If an agent is defined using domain-specific jargon, the corrections may be undesired.