{"_id":"5845a4a99f6fbb1b004307f9","__v":1,"category":{"_id":"5845a4a89f6fbb1b004307b9","version":"5845a4a89f6fbb1b004307b7","__v":0,"project":"54d3007669578e0d002730c9","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-30T06:25:25.645Z","from_sync":false,"order":1,"slug":"key-concepts","title":"Key Concepts"},"parentDoc":null,"version":{"_id":"5845a4a89f6fbb1b004307b7","project":"54d3007669578e0d002730c9","__v":2,"createdAt":"2016-12-05T17:32:24.708Z","releaseDate":"2016-12-05T17:32:24.708Z","categories":["5845a4a89f6fbb1b004307b8","5845a4a89f6fbb1b004307b9","5845a4a89f6fbb1b004307ba","5845a4a89f6fbb1b004307bb","5845a4a89f6fbb1b004307bc","5845a4a89f6fbb1b004307bd","5845a4a89f6fbb1b004307be","5845a4a89f6fbb1b004307bf","5845a4a89f6fbb1b004307c0","592deb23644f060f008e5aa6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"25.0.0","version":"25"},"project":"54d3007669578e0d002730c9","user":"55bf6cdcad601c2b00762d13","updates":["5934eca930694c002ff8cea9"],"next":{"pages":[],"description":""},"createdAt":"2016-05-29T22:13:52.778Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":12,"body":"* [Overview](#overview)\n* [How It Works](#how-it-works)\n* [Upload Examples](#upload-examples)\n* [How to Train Your Agent](#how-to-train-your-agent)\n * [Handle Unmatched Inputs](#section-handle-unmatched-inputs)\n * [Fix Annotations](#section-fix-annotations)\n * [Add Examples to Intents](#section-add-examples-to-intents)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Overview\"\n}\n[/block]\nTo achieve good classification accuracy, it’s important to provide your agent with enough data. The greater is the number of natural language examples in the ‘User says’ section of intents, the better is the classification accuracy. We encourage you to use <a href=\"https://docs.api.ai/docs/concept-intents#section-example-and-template-modes\" target=\"_blank\">example mode</a> instead of template mode since the former provides better data for machine learning.\n\nWhen you create a new intent, start with examples with the maximum number parameters. This way you will define what entities should be used in this intent and name all the parameters the right way. Having <a href=\"https://docs.api.ai/docs/concept-intents#section-example-annotation\" target=\"_blank\">annotated</a> the first few long examples, it will be easier for you to continue with shorter ones, as the system will start suggesting you the right entities for new examples. It also helps machine learning models train better.\n\nTo make the training process more efficient, we have created a Training tool that allows you to analyze conversation logs with your agent and add annotated examples to relevant intents in bulk.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"​Training is currently supported for English, German, Spanish, French, Italian, Russian, Japanese, and Simplified Chinese.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How It Works\"\n}\n[/block]\nAs you and your users chat with your agent, you can access the conversation logs by clicking ‘Training’ in the left side menu.\n\nFor your convenience, the logs are presented in two views:\n\n* **Training** shows conversations with the agent in the way, so you could review and improve its performance. Each user request is presented in a card showing the intent that will be used to process it, as well as the current annotation. You can reassign inputs to correct intents and fix annotations. Every time you approve changes, the agent is trained, and the results in the tab are updated.\n\n* **History** displays conversations in plain mode. This way you can see latest conversations with your agent in chronological order.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/dU6vbAGUQ6S81yggk8yQ_Trainig-overview.png\",\n        \"Trainig-overview.png\",\n        \"2058\",\n        \"866\",\n        \"#1b8e4d\",\n        \"\"\n      ],\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Upload Examples\"\n}\n[/block]\nYou can upload sample user inputs in a `.txt` file or in a `.zip` archive with multiple (up to 10) `.txt` files. Each input should start from a new line.\n\nA single `.txt` file or unpacked `.zip` archive should not exceed 3 MB.\n\nJust click the 'Upload' button in the right upper corner.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/K5LFA9uSHeimStVmubVd_Training-upload-examples.png\",\n        \"Training-upload-examples.png\",\n        \"2086\",\n        \"272\",\n        \"#2999e1\",\n        \"\"\n      ],\n      \"sizing\": \"full\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How to Train Your Agent\"\n}\n[/block]\nClick on a dialog (dialogs are named by the first user input in the session). You may see that some inputs don’t match to any intent or have incorrect annotations.\n\n##Handle Unmatched Inputs\n\nUnmatched inputs are marked by an exclamation mark. You can assign unmatched inputs to intents in two ways:\n* Add inputs to one of the existing intents\n* Create a new intent with this input\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/pqsFjWBzTRWCR6FUXpbH_Training-options-for-unmatched.png\",\n        \"Training-options-for-unmatched.png\",\n        \"2402\",\n        \"940\",\n        \"#2a99e1\",\n        \"\"\n      ],\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\n##Fix Annotations\n\nIn the case of incomplete or incorrect annotation, fix it the same way as you do when adding or editing examples in intents.\n\nThis example shows an incomplete annotation:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/vV5G5vTXQQmIIOH9VjbG_Training-incomplete-annotation-1.png\",\n        \"Training-incomplete-annotation-1.png\",\n        \"2432\",\n        \"950\",\n        \"#3ab970\",\n        \"\"\n      ],\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\nHere’s the same input with fixed annotation:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/zvni9KDRmiSx4Jw3Io0z_Training-Incomplete-annotation-fixed-1.png\",\n        \"Training-Incomplete-annotation-fixed-1.png\",\n        \"2466\",\n        \"1064\",\n        \"#3fbb7a\",\n        \"\"\n      ],\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\nIf an entity used for annotation doesn’t contain the annotated word/phrase, it’ll be automatically added to this entity as a new entry unless the 'Allow automated expansion' option is checked.\n\n##Add Examples to Intents\n\nWhen you edit an input, a green check mark appears on the right. It means that the input will be added to the assigned intent.\n\nIf you don’t want to add the input, click on the Ignore button right below the check button. \n\nOnce you’ve reviewed all the inputs in the session, click the Approve button to add all the fixed inputs to the respective intents. Your agent will start training immediately. It’ll show a notification when the training has been completed.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you add several inputs containing identical text to the same intent, the value of the “count” field in the JSON representation of the intent will increase by the respective number.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"There is no need to assign user inputs used for slot filling to any intents.\"\n}\n[/block]","excerpt":"","slug":"training","type":"basic","title":"Training"}
* [Overview](#overview) * [How It Works](#how-it-works) * [Upload Examples](#upload-examples) * [How to Train Your Agent](#how-to-train-your-agent) * [Handle Unmatched Inputs](#section-handle-unmatched-inputs) * [Fix Annotations](#section-fix-annotations) * [Add Examples to Intents](#section-add-examples-to-intents) [block:api-header] { "type": "basic", "title": "Overview" } [/block] To achieve good classification accuracy, it’s important to provide your agent with enough data. The greater is the number of natural language examples in the ‘User says’ section of intents, the better is the classification accuracy. We encourage you to use <a href="https://docs.api.ai/docs/concept-intents#section-example-and-template-modes" target="_blank">example mode</a> instead of template mode since the former provides better data for machine learning. When you create a new intent, start with examples with the maximum number parameters. This way you will define what entities should be used in this intent and name all the parameters the right way. Having <a href="https://docs.api.ai/docs/concept-intents#section-example-annotation" target="_blank">annotated</a> the first few long examples, it will be easier for you to continue with shorter ones, as the system will start suggesting you the right entities for new examples. It also helps machine learning models train better. To make the training process more efficient, we have created a Training tool that allows you to analyze conversation logs with your agent and add annotated examples to relevant intents in bulk. [block:callout] { "type": "info", "body": "​Training is currently supported for English, German, Spanish, French, Italian, Russian, Japanese, and Simplified Chinese." } [/block] [block:api-header] { "type": "basic", "title": "How It Works" } [/block] As you and your users chat with your agent, you can access the conversation logs by clicking ‘Training’ in the left side menu. For your convenience, the logs are presented in two views: * **Training** shows conversations with the agent in the way, so you could review and improve its performance. Each user request is presented in a card showing the intent that will be used to process it, as well as the current annotation. You can reassign inputs to correct intents and fix annotations. Every time you approve changes, the agent is trained, and the results in the tab are updated. * **History** displays conversations in plain mode. This way you can see latest conversations with your agent in chronological order. [block:image] { "images": [ { "image": [ "https://files.readme.io/dU6vbAGUQ6S81yggk8yQ_Trainig-overview.png", "Trainig-overview.png", "2058", "866", "#1b8e4d", "" ], "sizing": "80" } ] } [/block] [block:api-header] { "type": "basic", "title": "Upload Examples" } [/block] You can upload sample user inputs in a `.txt` file or in a `.zip` archive with multiple (up to 10) `.txt` files. Each input should start from a new line. A single `.txt` file or unpacked `.zip` archive should not exceed 3 MB. Just click the 'Upload' button in the right upper corner. [block:image] { "images": [ { "image": [ "https://files.readme.io/K5LFA9uSHeimStVmubVd_Training-upload-examples.png", "Training-upload-examples.png", "2086", "272", "#2999e1", "" ], "sizing": "full" } ] } [/block] [block:api-header] { "type": "basic", "title": "How to Train Your Agent" } [/block] Click on a dialog (dialogs are named by the first user input in the session). You may see that some inputs don’t match to any intent or have incorrect annotations. ##Handle Unmatched Inputs Unmatched inputs are marked by an exclamation mark. You can assign unmatched inputs to intents in two ways: * Add inputs to one of the existing intents * Create a new intent with this input [block:image] { "images": [ { "image": [ "https://files.readme.io/pqsFjWBzTRWCR6FUXpbH_Training-options-for-unmatched.png", "Training-options-for-unmatched.png", "2402", "940", "#2a99e1", "" ], "sizing": "80" } ] } [/block] ##Fix Annotations In the case of incomplete or incorrect annotation, fix it the same way as you do when adding or editing examples in intents. This example shows an incomplete annotation: [block:image] { "images": [ { "image": [ "https://files.readme.io/vV5G5vTXQQmIIOH9VjbG_Training-incomplete-annotation-1.png", "Training-incomplete-annotation-1.png", "2432", "950", "#3ab970", "" ], "sizing": "80" } ] } [/block] Here’s the same input with fixed annotation: [block:image] { "images": [ { "image": [ "https://files.readme.io/zvni9KDRmiSx4Jw3Io0z_Training-Incomplete-annotation-fixed-1.png", "Training-Incomplete-annotation-fixed-1.png", "2466", "1064", "#3fbb7a", "" ], "sizing": "80" } ] } [/block] If an entity used for annotation doesn’t contain the annotated word/phrase, it’ll be automatically added to this entity as a new entry unless the 'Allow automated expansion' option is checked. ##Add Examples to Intents When you edit an input, a green check mark appears on the right. It means that the input will be added to the assigned intent. If you don’t want to add the input, click on the Ignore button right below the check button. Once you’ve reviewed all the inputs in the session, click the Approve button to add all the fixed inputs to the respective intents. Your agent will start training immediately. It’ll show a notification when the training has been completed. [block:callout] { "type": "info", "body": "If you add several inputs containing identical text to the same intent, the value of the “count” field in the JSON representation of the intent will increase by the respective number." } [/block] [block:callout] { "type": "info", "body": "There is no need to assign user inputs used for slot filling to any intents." } [/block]