How to Configure Questions And Answers
About Questions And Answers
The Questions and Answers component contains 3 main parts:
- Entity to Filter mappings
- Intent to Base Query mappings
- Conversation responses settings (in order):
- Featured Results
- NLQ Q&A
- Conversation Topics
The Questions And Answers page is located under the SmartHub Administration page at: http(s)://<smarthub-web-app-url>/_admin.
-
For more details about configuring Questions and Answers types, including using intent, see How to Automatically Generate Answers to User Questions.
Storage Settings
The conversation responses are saved in an Elastic index, and the HTML templates/adaptive cards templates used inside a conversation are physically saved on disk.
To configure the Elastic settings, follow the next steps:
- Navigate to the General Settings page. It is located under ADMINISTRATION section of the SmartHub Administration page.
- In the Storage Settings section click Edit.
- Enter the information for your Indexes and Elastic Server settings.
Bot Templates
To configure where the templates are saved, enter the path in the BotTemplatesPath
variable from web.config file found in the SmartHub root directory.
The default location for the bot templates is the BotTemplates folder.
<add key="BotTemplatesPath" value="~/BotTemplates" />
Entity-to-Filter Mappings
This section contains the mappings between SmartHub filters/refiners and NLQ Service application entities.
-
An entity from the NLQ Service application must have a connection to a refiner from SmartHub.
-
To access Entity-to-Filter mappings, select Questions And Answers from the navigation menu on the left side of the page.
-
Select the settings sprocket to access the drop-down menu that contains Entity-to-Filter mappings.
Note: The managed property used as a filter (refiner) must be searchable and queryable.
- Click the "Click to view the query used to get the refiners" link at the top of the page
- A sub-section opens with the query run in the search center to get the managed properties. The administrator can change it.
- The administrator must choose an Entity and a Filter.
- Click the Add Mapping.
- Enter your code.
- After all changes are made, click Save.
Intent to Base Query Mappings
This section contains the mappings between the following:
- Intents from the NLQ service application
- A query
Mappings Used in This Case
After the NLQ service detects the intent of the question and that the user follows the conversation steps, SmartHub returns the results based on the user choice and the query associated with the intent.
Example
Based on the code in the image below, the following query is run in the Search Center:
customer AND "DisplayAuthor":"Administrator".
Export Questions and Answers Entries
This section describes how to export the indexed Questions And Answers to a .csv file.
This applies to ALL types of Q&A entries:
- Conversation Entries
- NLQ Q&A
- Featured Results
To use:
- Click on "Conversation Topics" and select the type of conversation you want to export:
- Conversation Topics
- Question and Answers
- Featured Results
- Click the sprocket icon.
- Click Export <conversation type>.
- File Name: The name of the .csv file.
- By default, the file name will be "SH Bot *type of conversation to be exported* *current date and time*"
- For example, for Featured Results, the default file name will be SH Bot Featured Results *current date time*.csv
- Enter the desired file name (or leave default) and click Export.
- A .csv file with the desired name is downloaded:
The newly downloaded .csv file contains all properties of the exported type:
Import Questions And Answers Entries
This section describes how to import a .csv file containing Questions And Answers of a specific type and adds them to the Elastic index.
This applies to ALL types Q&A entries:
- Conversation Entries
- Questions and Answers
- Featured Results
To use:
- Click on "Conversation Topics" and select the type of conversation you want to import:
- Conversation Topics
- Question and Answers
- Featured Results
- Click the sprocket icon.
- Click Import <conversation type>.
- Click Choose File and select the .csv file containing the conversations that you want to import.
- Click Import. The .csv contents are translated to the appropriate Conversation Type and added to the Elastic index
Note: All items in the .csv file you want to import must be of the same type.
For example, if you want to import Featured Results, all items in the .csv file must be of type "Featured Results".
The imported CSV file has the following format:
- 1st row: Property names
- 2nd row onward: Property values
Delete Question And Answer Entries
This feature enables you to delete all items of a certain type from the Elastic Index.
This applies to ALL types Q&A entries:
- Conversation Entries
- Questions and Answers
- Featured Results
To use:
- Click on "Conversation Topics" and select the type of conversation you want to delete:
- Conversation Topics
- Question and Answers
- Featured Results
- Click the sprocket icon.
- Click Delete <conversation type>.
- On the Delete Conversation Topics confirmation page, select one of the following:
- Cancel - You are returned to the "Questions And Answers" page and no items are deleted
- Delete - All items of the selected type will be deleted from the Elastic Index
Conversation Response Settings
When SmartHub receives a natural language query, it attempts to find a match, progressively, for:
- Featured Results
- If no match is found, SmartHub calls the NLQ provider and based on the identified entity and intents, SmartHub tries to find a match for:
- NLQ Q&A
- If no Q&A match is found:
- Conversation
- A match for a conversation (which consists of one or more conversation topics).
- If no conversation step match is found, the bot does not have a relevant suggestion.
How to Configure Featured Results
Use the following instructions to configure a Featured Results.
- On the Questions And Answers page, click Conversation Topics.
- Select Featured Results.
- Click the "+" icon next to the "Featured Results" text at the top left of the screen.
- Start date: the date on which the featured result begins.
- Expiration date: the date the featured result expires.
- Name (at top of screen): Choose a relevant name for the Featured Result.
- Priority:
- Choose the priority of feature results in case that, there are multiple "Feature Results" with the same query term.
- Based on the priority configured, "Featured Results" is returned in search results.
- "When the user searches for"
- Add query terms here.
- There two types of query terms:
- Regular strings. For example: priority, case, version
- Regex strings Pattern for regex matching.
- For example: ([A-Z])\w+
- For example: ([A-Z])\w+
- "query comes from these sources"
- Add results source IDs.
- This field will contain a list with results source IDs of the user's query
- "ALL" is the default value.
- It means that all results source IDs will be considered as valid.
- It means that all results source IDs will be considered as valid.
- Choose the response method:
- "answer" - "HTML response": What the bot tells the user before the results are listed.
- "search for" - "Query To Run template":
- Generates the query made to SmartHub if a match is found for this item (hover over the icon to see which fields can be used inside the template).
- Choose a results source ID used to run the query and display results.
- The default value is "Current Source Id" which represents the result source id of the query made by user.
- Choose the template from the last field:
- Regular results
- Cards
- Carousel
- For cards or carousel display mode choose.
- n results - the top n results will be listed in SmartHub search page.
- Adaptive Cards JSON - The JSON template used to render the bot results.
Answer Display Mode
Regular Results Display Mode
Cards/carousel display mode
How to Configure NLQ Q&A
Use the following instructions to configure a Question and Answer.
- On the Questions And Answers page, click on Conversation Topics.
- Select NLQ Q&A.
- Click the "+" icon next to the "NLQ Q&A" label at the top left of the screen.
- Choose a relevant name for the NLQ Q&A.
- Choose the NLQ Service intents that matches this Q&A.
- Choose the response method:
- "answer" - "HTML response":
- This specifies what the bot tells the user before the results will be listed.
- "search for" - "Query To Run json object":
- Generates the query to be executed by SmartHub if a match is found for this item. You can click on this query to open the query builder panel.
- Generates the query to be executed by SmartHub if a match is found for this item. You can click on this query to open the query builder panel.
- "answer" - "HTML response":
- On the left side, you can see the most common properties that can be altered in the query. The JSON query on the right side will be updated based on your input.
- Choose whether you want to pick up specific metadata from your results or the entire results set.
- metadata: Choose which metadata field to extract from results
- metadata: Choose which metadata field to extract from results
- Choose the template from the last field:
- regular results
- cards
- carousel
- To use a "cards" or "carousel" display mode choose:
- Display text: The text to be displayed on top of the card or carousel
- Adaptive Cards JSON: The JSON template used to render the bot results
Regular Results Display Mode
Cards/carousel Display Mode
How to Configure "Conversation Topics"
Use the following instructions to configure a Conversation Topic.
- On the Questions And Answers page, click on Conversation Topics.
- Click the "+" button.
- Choose a relevant name for the Conversation Topic.
- Choose the NLQ Service intents that match this Conversation Topic.
- Choose the filter mapped to the NLQ Service entity.
- This is the filter for which SmartHub suggests refinement after the associated NLQ Service entity is recognized.
- The entity is populated automatically based on the mappings.
- Bot reply template: Generates a short message displayed by the bot before showing the recommended values.
- Choose how many filter values should be recommended by bot.
- Choose recommended filter values.
- These values are suggested by the bot.
- These values are suggested by the bot.
How to Use Bot Templates
Note: Bot Templates are available for "Questions and Answers" and "Featured Results"
Creating a new template:
- Populate the Template name field. If the field is empty the new template will use the same name as the conversation item.
- Populate the template field.
- Save the conversation item.
- The template is created.
- It is available to use for other templates.
Selecting an existing template with the "Chose a file " button:
- A pop-up will open showing you all the available templates.
- Selecting a template populates the Template Name and the template fields.
-
Modifying the template and then saving the conversation item updates the selected template.
Note: The changes are visible in all the conversations that use that template.
-
Modifying the template name and saving will create a new template with the specified name.