Answer Intents

In some cases, a user's question requires only a single answer and no further conversation. Answer intents enable your skill to output these types of replies without you having to update the dialog definition.

You can create answer intents in the following ways:

  • Use the Knowledge feature to generate answer intents from an existing resource, such as an FAQ that is hosted on a web page or in a PDF document.
  • On the skill's Intents page, define answer intents like you would any other intent but also include an answer in the Answer field.
  • Do bulk creation of answer intents by uploading a CSV file.

Here are a few more things you need to know about answer intents:

  • Skills with answer intents should be trained with Trainer Tm.
  • Unlike regular intents, you don't need to map answer intents to flows (in the Visual Flow Designer) or to states with System.Intent actions (in the YAML editor).
    • In the Visual Flow Designer, you can create a standard flow that handles all answer intents, map specific answer intents, or use a combination of the approaches.
    • In the YAML editor, you just need to have a System.Intent component to resolve the answer intents.
  • You can optionally store the answer intent in a resource bundle by clicking This is an image of the resource bundle icon.The resource bundle entries for answer intents are listed in the resource bundle's Q&A page.

Generate Answer Intents from an Existing Knowledge Resource

If you already have a web page or PDF document with question and answer pairs, you can use the Knowledge feature to ingest those Q&A pairs from the document and generate answer intents automatically. (Other text in the document that is not organized as question/answer pairs is ignored.) When you create answer intents this way, example utterances are also generated for the intents.

To generate answer intents from a question and answer document:

  1. In the left navbar of the skill, click the Knowledge icon.
  2. Click + Knowledge Document.
  3. In the New Knowledge Document dialog:
    1. Specify a name and language for the document.

      For the language, you can select from the natively-supported languages that you have specified for your skill.

    2. Select PDF or HTML and upload the document, or select URL.

      If you are providing a URL, it must point to a static HTML page containing the FAQ.

    3. If the document is a PDF or HTML document for upload, select the checkbox acknowledging that it will be temporarily stored.
    4. Click Create.

    Note:

    The URL option only works for HTML web pages. If you want to import an online PDF file, you need to first download it from the web page and then upload it into Digital Assistant.
  4. Wait for the generation of the answer intents to occur.

    (The status and progress of the job will be updated every 10 seconds.)

  5. Once the job is completed, click Review Intents to go over the generated intents and training utterances. Pay particular attention to each question and answer to make sure that each contains the right text.

    Tip:

    For PDF documents, you can click Open PDF to view a color-coded version of the document to see what text was used to generate the intents and how it was divided into questions and answers.
  6. To edit an intent's name, question, answer, or utterances, click its Edit icon.

    Note:

    You can also later edit these values on the Intents page.
  7. For an intents that you don't want added to the skill, clear the Include checkbox.
  8. Click Add Intents to Skill to add the generated intents to the skill.
  9. In the left navbar, click Intents This is an image of the Intent icon. and make any further adjustments to the intents, such as changing the conversation name and adding further example utterances.

The answers are generated with HTML tags for formatting that is included in the original for things like bold text, italics, and hyperlinks. This markup is then automatically transformed into the appropriate markup or markdown for the channels through which the skill is exposed. (If the channel doesn't support formatting, the tags are removed when the message is sent through that channel.) See Rich Text Formatting in Channels.

Note:

There is a limit of 100 answer intents that can be created at a time. If your knowledge document has more than 100 question/answer pairs, divide the document into smaller documents and create the answer intents from each of those documents.

Create a Single Answer Intent

If you need just a few answer intents, you can create them similarly to how you create regular intents.

  1. Click Intents This is an image of the Intent icon. in the left navbar.
  2. Click Add Intent.
  3. Click This is an image of the Edit icon to enter a descriptive name or phrase for the intent in the Conversation Name field.
  4. Add the intent name in the Name field. If you don't enter a conversation name, then the Name field value is used instead.

    Note:

    In naming your intents, do not use system. as a prefix. system. is a namespace that's reserved for the intents that we provide. Because intents with this prefix are handled differently by Trainer Tm, using it may cause your intents to resolve in unexpected ways.
  5. Click
    This is an image of the Edit icon.

    and then add an answer to the Answer field. Apply formatting to the text as needed.

  6. In the Examples section, add training utterances that reflect typical ways that users would express the question that the intent is answering.

Create Answer Intents from a CSV File

You can create answer intents in bulk by importing a CSV file. This file is similar to the standard intent CSV file, but in addition to the query, topIntent, and conversationName columns, it also has the answer column:
query,topIntent,conversationName,answer
What are your hours?,StoreHours,Our Store Hours,"We're open from 9-5, Mondays-Thursdays or by appointment."
When are you open?,StoreHours,Our Store Hours,"We're open from 9-5, Mondays-Thursdays or by appointment."
When do you close?,StoreHours,Our Store Hours,"We're open from 9-5, Mondays-Thursdays or by appointment."
What do you sell?,Products,Our Products,We sell only hammers. All types.
Do you sell brick hammers?,Products,Our Products,We sell only hammers. All types.
Do you sell claw hammers?,Products,Our Products,We sell only hammers. All types.
Do you deliver?,Delivery_and_Pickup,Pickup and Delivery options,"No delivery service, sorry. Purchases are in-store only"
Can I buy one of your hammers on the web?,Delivery_and_Pickup,Pickup and Delivery options,"No delivery service, sorry. Purchases are in-store only"
Can you mail me a hammer?,Delivery_and_Pickup,Pickup and Delivery options,"No delivery service, sorry. Purchases are in-store only"
Can I return a hammer?,Returns,Our Return Policy,You cannot return any items. All sales are final.
My hammer doesn't work,Returns,Our Return Policy,You cannot return any items. All sales are final.
Can I exchange my hammer,Returns,Our Return Policy,You cannot return any items. All sales are final.