Structured Data Sources

Structured data sources in DRUID are organized formats from which the system can extract QnA pairs for the Knowledge Base. These sources include Excel and PDF files that adhere to specific formatting rules to ensure accurate data extraction:

Structured Excel Files:

  • Table Headers: The first row of your table must contain two columns with the exact headers in this order: "Questions" and "Answers."
  • Note:  Starting with DRUID 7.15, the platform accepts Excel files with table headers that include spaces (e.g., "Question" and "Answer"). The platform automatically trims these spaces to ensure accurate data extraction. Additionally, it supports Excel documents with multiple sheets, capturing the sheet name in the "sheetName" property for each extracted article.
  • Question Length: Each question should be limited to a maximum of 625 characters. Any content exceeding this limit will be truncated during upload.

Structured PDF Files:

  • Question Formatting: All questions must be in bold text and end with a question mark ("?").
  • Question Length: As with Excel files, limit each question to a maximum of 625 characters to avoid truncation during upload.
Note:  Uploading files that deviate from these formatting requirements may lead to inaccurate QnA extractions.

Unlike other data sources, structured data sources also allow you to manually add new QnA pairs.

Adding a Structured Data Source

To add a structured data source, follow these steps:

  1. Click the Add New button to open the Add New Data Source page.
  2. In the Name field, enter a name for the data source to help you identify and search for it easily.
  3. From the Language drop-down, select the language of the data you are uploading. It must be one of the bot languages.
  4. From the Type drop-down, select Structured Documents and from the File Type field, choose either Excel File (Structured) or PDF File (Structured).
  5. Click Browse to locate your data source file on your system, select the file and click Open.
  6. Optionally, set the Min score threshold and the Target match score for the data source. If not set, the thresholds from the Knowledge Base will apply.
  7. Click the Create button. The KB Engine starts to extract the data from the selected file.

Note:  

The extraction might take a few seconds, depending on the file size. You might need to refresh the page several times until the data source status changes to "Requires training."

Click the Train button at the top-left corner of the data source to ensure the updates are recognized by the Knowledge Base Engine.

To view the extracted QnA pairs within the data source, click on the data source.

We recommend you review the QnA pairs regularly to keep the articles relevant. You can:

  • Edit the QnA pairs.
  • Manually add new QnA pairs.
  • Promote them to QnA flows or child intents.
  • Delete outdated QnA pairs.
Important!  After updating QnA pairs, click the Train button at the top-left corner of the data source to ensure the Knowledge Base Engine recognizes the updates.
Hint:  We recommend testing the data source performance and editing existing QnA pairs to enhance it.

Testing the data source performance

Testing the performance of a data source is important because it ensures that the extracted question-and-answer pairs are relevant. This process helps identify and rectify any issues, improving the overall quality and effectiveness of your bot's responses. By validating the data source performance, you can enhance user satisfaction.

To test the performance of the data source, on the QnA Pairs page, in the User Says area, enter a question and select the language.

All matched QnA pairs will be displayed along with their scores.

You can improve the performance of the data source by reviewing and editing QnA pairs based on your needs.

Editing existing QnA pairs

You can keep your data source up-to-date by editing existing question-and-answer (QnA) pairs.

To modify a QnA pair, follow these steps:

  1. Locate the QnA pair you want to edit. Click the dots () next to the desired pair and select Edit.
  2. Make your changes. In the edit window, update the question, answer, or both fields as needed.
  3. Click the Save button to confirm your changes.
Note:   After making any modifications to your QnA pairs, it's crucial to retrain your data source. This ensures the KB Engine recognizes these updates and provides accurate responses to user queries. Click the Train button at the top-left corner of the data source.

Manually adding new QnA pairs

You expand your knowledge base by adding new QnA pairs directly.

To create a new QnA pair manually, follow these steps:

  1. Click the Add button at the top right corner of your data source.
  2. Enter the question and answer. In the pop-up window, type the new question in the Question field and the corresponding answer in the Answer field.
  3. Click the Save button to finalize the creation of the new pair.
Note:   Don't forget to retrain your data source after adding new QnA pairs. Retraining guarantees the KB Engine recognizes these additions and provides consistent responses to user inquiries. Click the Train button at the top-left corner of the data source.

Promoting QnA pairs to QnA flows or transforming them into child intents

If the bot's NLP model cannot match a user's intent with existing flows, it will search the Knowledge Base. If it finds a match, the bot will use that QnA pair to answer the user and then enter "Idle" mode, waiting for a new intent.

To create simple business conversations, you can promote specific QnA pairs from the Knowledge Base to QnA flows. When you promote a QnA pair to a QnA flow, the flow will include one Message step with these characteristics:

  • Primary Question: The question in the QnA pair becomes the primary question, the first training phrase in the flow step.
  • Response Message: The answer from the QnA pair becomes the Message set in the QnA flow step.
Hint:  Add two or more similar questions when promoting a QnA pair to a QnA flow to create a comprehensive user intent for that flow.

To use a QnA pair for additional context awareness within a parent flow, transform the QnA pair into a child intent.

To promote a QnA pair to a QnA flow or child intent, follow these steps:

  1. In the Knowledge Base, select the desired data source.

  2. Locate the QnA pair. If your data source has many QnA pairs, you can search by question or answer.

  3. Click on the dots () next to your QnA pair, then select Promote to QnA.
  4. The Promote to QnA page opens.

  5. Fill out the fields described in the table below.
  6. Field

    Description

    Name

    The name of the QnA in the DRUID AI Platform. This field is mandatory.

    Description

    A description of the QnA. This field is mandatory and localizable in the bot's languages. The bot will use this description to help users choose the appropriate QnA if multiple QnAs match the user's question.

    Hint:  Authoring time translation is available for QnA description (if set on the bot).

    Category

    For easier filtering and efficiency, categorize your QnA. This field is mandatory.

    Response Message

    The answer to the user's question. This message is mandatory and localizable in all bot languages.

    Subflow

    Select this if you want to promote the QnA pair to a QnA flow and transform it into a child intent.

    Parent flow

    Select the parent flow if you want to transform the QnA pair into a child intent of a specific parent flow.

    Training Phrases

    The primary question from the QnA pair. Add alternate questions in all bot languages.

    Authentication

    Required

    Select if the QnA requires authentication (useful for bots interacting with existing customers or employees).

  7. Click Save. The QnA pair will be marked with a green QA label. You can edit or delete the QnA pair.

The data source requires training. Click the Train button at the top-left corner of the page.

Deleting articles

You can remove unwanted articles from your structured data source to maintain its accuracy and relevance.

To delete an article, follow these steps:

  1. Click on the data source you want to manage.
  2. In the QnA Pairs list, click the dots () next to the text article and click Delete.
  3. In the confirmation dialog, click Yes.

After marking an article for deletion, it will appear grayed out. This indicates it's flagged for removal but hasn't been permanently deleted yet. To undo the deletion, simply click the dots () next to the grayed-out article and select Undo.

Note:  For your changes to take effect, you must train the data source after marking articles for deletion. Click the Train button at the top left corner of the data source. Once training is complete, the articles are permanently removed from the data source, and this action is irreversible.

Compare the original data source file with the current data source articles

You can compare the original data source with the current data source by downloading them in Excel format.

To download the current data source:

  1. Go to the data source.
  2. Click the Download icon at the top left corner of the QnA Pairs page.

To download the original data source:

  1. Click the Details tab.
  2. Click the Download button below 'Download original file'.

Both Excel files contain two columns: Question and Answer. To compare the articles, open the two downloaded files side-by-side and compare their contents.

Replacing the content of a structured data source

DRUID allows you to replace all text articles from a data source in the Knowledge Base with articles from another data source.

Note:  This process does not merge the articles; it completely replaces the original articles with those from the new data source.

To replace a structured data source, follow these steps:

  1. In the Knowledge Base page, click on the desired structured data source.
  2. Click the Details tab.
  3. In the Replace File field, click Browse, then locate and select the new data source file.
  4. Note:   You can only replace a data source with another data source of the same type as the original.

  5. Click the Save button to extract QnA pairs from the new data source. The new data source replaces the original one if no errors occurred.
  6. Click on the QnA Pairs tab and click the Train button at the top left corner of the page to train the data source.