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."
- 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.
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:
- Click the Add New button to open the Add New Data Source page.
- In the Name field, enter a name for the data source to help you identify and search for it easily.
- From the Language drop-down, select the language of the data you are uploading. It must be one of the bot languages.
- From the Type drop-down, select Structured Documents and from the File Type field, choose either Excel File (Structured) or PDF File (Structured).
- Click Browse to locate your data source file on your system, select the file and click Open.
- 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.
- Click the Create button. The KB Engine starts to extract the data from the selected file.
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.
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:
- Locate the QnA pair you want to edit. Click the dots (
) next to the desired pair and select Edit.
- Make your changes. In the edit window, update the question, answer, or both fields as needed.
- Click the Save button to confirm your changes.
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:
- Click the Add button at the top right corner of your data source.
- 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.
- Click the Save button to finalize the creation of the new pair.
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.
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:
-
In the Knowledge Base, select the desired data source.
-
Locate the QnA pair. If your data source has many QnA pairs, you can search by question or answer.
- Click on the dots (
) next to your QnA pair, then select Promote to QnA.
- Fill out the fields described in the table below.
- Click Save. The QnA pair will be marked with a green QA label. You can edit or delete the QnA pair.
The Promote to QnA page opens.
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). |
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:
- Click on the data source you want to manage.
- In the QnA Pairs list, click the dots (
) next to the text article and click Delete.
- 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.
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:
To download the original data source:
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.
To replace a structured data source, follow these steps:
- In the Knowledge Base page, click on the desired structured data source.
- Click the Details tab.
- In the Replace File field, click Browse, then locate and select the new data source file.
- 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.
- Click on the QnA Pairs tab and click the Train button at the top left corner of the page to train the data source.