Datasets >Q&A

What are Q&A and why should I consider using them in my bot?

Q&A stands for Questions & Answers. It is the simplest way to link an intent to a response. If you need more complex interactions involving multi-turn dialogues, dynamic answers, and the use of external API calls, you should consider using dialog flows. However, if you need simple interactions involving one question-to-one response pairs, Q&A will be very helpful.

Do I have to choose between Q&A and Dialog flows?

Nope, you can use both! 🙂 What will happen then is that during the training of the bot, all the intents will be merged together into a big NLU Model. Then, here is what happens with each user request:

  1. The dialog engine asks the NLU Model for the best intent found in the user request.
  2. The dialog engine will search for a match in the dialog flow.
  3. If no answer is found in the dialog flow, the dialog engine will try the Q&A. Below is an illustration of this workflow.

Managing Your Q&A: The Actions Menu

All global management tasks are handled through the Actions menu, located at the top right of the screen.

  • Add question: Opens a window to create a new question-and-answer pair manually.
  • Import from file: Allows you to bulk upload Q&A pairs from a CSV file.
  • Export all: Downloads your entire Q&A library into a single file for backup or analysis.
  • Train: After adding or changing Q&A, you must run the training for the changes to take effect.
  • Delete all: Permanently removes all Q&A pairs from your dataset.

Creating Questions/Answers

The Q&A component is available at the following location: Datasets > Q&A

Add a question/answer pair

To add a new entry to your knowledge base, navigate to the Q&A tab and click the "Add question" button in the Actions menu. This will open the "Add Q&A" configuration window.

You will then be prompted with a Q&A form where you can add the question and the answer.

Core Components

The form is divided into core components and advanced options.

Question name: This serves as both the internal name for your Q&A and the name of the intent that will be automatically created.

Variations: This is where you list all the different ways a user might ask this question. Each variation should be on a new line. The more high-quality variations you provide (we recommend at least 5), the better the bot will be at understanding the user's intent.

Answers: Define the response the bot should give. You have several options:

  • Add text answer: Creates a simple text response.
  • Add rich answer: Allows you to build a more complex response using JSON, such as a message with buttons, a carousel, or an image.
  • You can add multiple answers. If you do, the bot will pick one at random each time the intent is triggered.

Description: An internal field where you can describe the purpose of this Q&A. This is helpful for team collaboration and future reference.

Advanced Options

Click "Show more options" to reveal advanced settings that add powerful functionality to your Q&A.

  • Category: Assign an optional category to this Q&A. This helps you organize and filter your knowledge base as it grows.
  • Answer survey: When enabled, this will automatically display a simple "Thumbs Up / Thumbs Down" feedback survey right after the bot gives this answer.
  • Conversation survey: When enabled, this will trigger a full conversation survey after the interaction.
  • Suggestion label: If your bot uses intent suggestions (disambiguation), you can enter text here. This text will appear on a suggestion button if the bot is unsure about the user's intent.
  • Autocompletion: If enabled, the phrases in the "Variations" field can be used as suggestions in the web chat's autocompletion feature as the user types.

🚧 Use Autocompletion with Care

It is highly recommended to only enable autocompletion for intents that do not handle personal or sensitive data, as the training phrases could be suggested to any user.

For better performance, you should add multiple variations to each question. These variations will help the bot learn and achieve a better understanding rate for your FAQ.

📘

How many variations are necessary?

We recommend at least 5 variations per question. For tips on how to design those variations, you can check our tips here.

What message formatting is possible for Q&A responses?

You can add some HTML tags to your responses. Here is a list of the whitelisted tags:

<b> bold text </b>
<i> italic text </i>
<br> new line
<a href="https://linux.org" target="_new"> This is the URL to the Linux website </a>
🚧

target="_new"

If you want to add links in your Q&A, you will use the <a> tag. It is important to add the target="_new" parameter in the <a> tag so the URL will be opened in a new tab and not in the webchat itself. 😉

Using import files

If you already have a large FAQ file, you can leverage this data and upload it directly to the bot platform.

You can get a pre-formatted file by clicking on the button at the center of the Datasets > Q&A section. A file download will start.

📘

Use our template to get the right file format

To ensure special characters are well-managed by the platform, use our template (as shown below) and then replace its content with yours. Otherwise, the file format supported by the platform is CSV UTF8 + BOM with ; separation.

Open the file and update the content with the Q&A you want to push to your bot. Hit save as and rename the file.

Upload your new file by clicking "Import Q&A" and selecting it.

Your Q&A should appear. All the intents have been automatically created. :) Click the Train button to launch the training of your bot with these new intents.

🚧

Updating your Q&A

If you already have Q&A, a popup will ask you for confirmation before overwriting your current Q&A with the one from your file.

You can now ask questions from your Q&A from the Simulator and from all your bot channels!

Good to know

  • Once the user request is received, the bot will first check your dialog flows, then your Q&A.
  • You can use our "Chit Chat" template in a dedicated bot.
  • Try to adapt your website FAQ to the conversational format with shorter messages. Long text usually doesn't work well on chat channels.