Skip to content

Commit d0820be

Browse files
committed
address acrolinx
1 parent c8db828 commit d0820be

File tree

2 files changed

+25
-26
lines changed

2 files changed

+25
-26
lines changed

articles/ai-services/language-service/question-answering/concepts/best-practices.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.service: azure-ai-language
55
author: laujan
66
ms.author: lajanuar
77
ms.topic: conceptual
8-
ms.date: 07/16/2025
8+
ms.date: 07/17/2025
99
ms.custom: language-service-question-answering
1010
---
1111

@@ -19,15 +19,15 @@ Custom question answering is continually improving the algorithms that extract q
1919

2020
## Creating good questions and answers
2121

22-
We've used the following list of question and answer pairs as representation of a project to highlight best practices when authoring projects for custom question answering.
22+
We use the following list of question and answer pairs to represent a project. This approach helps highlight best practices when creating projects for custom question answering.
2323

2424
| Question | Answer |
2525
|----------|----------|
2626
| I want to buy a car |There are three options to buy a car.|
2727
| I want to purchase software license |Software license can be purchased online at no cost.|
2828
| What is the price of Microsoft stock? | $200. |
2929
| How to buy Microsoft Services | Microsoft services can be bought online.|
30-
| Want to sell car | Please send car pics and document.|
30+
| Want to sell car | Send car pics and document.|
3131
| How to get access to identification card? | Apply via company portal to get identification card.|
3232

3333
### When should you add alternate questions to question and answer pairs?
@@ -45,55 +45,55 @@ The service can return the expected response for semantically similar queries su
4545
"What is the market value of a Microsoft stock?"
4646
"What is the market value of a Microsoft share?"
4747

48-
However, it's important to understand that the confidence score with which the system returns the correct response will vary based on the input query and how different it is from the original question answer pair.
48+
The confidence score that the system assigns to its response can vary. This variation depends on the input query and how much it differs from the original question-answer pair.
4949

50-
There are certain scenarios that require the customer to add an alternate question. When it's already verified that for a particular query the correct answer isn't returned despite being present in the project, we advise adding that query as an alternate question to the intended question answer pair.
50+
There are certain scenarios that require the customer to add an alternate question. If you already verified that a specific query doesn't return the correct answer, even though the answer exists in the project, we recommend taking further action. Add that query as an alternate question to the intended question and answer pair. This step can help ensure users receive the correct response in the future.
5151

5252
### How many alternate questions per question answer pair is optimal?
5353

54-
Users can add as many alternate questions as they want, but only first 5 will be considered for core ranking. However, the rest will be useful for exact match scenarios. It is also recommended to keep the different intent/distinct alternate questions at the top for better relevance and score.
54+
Users can add as many alternate questions as they want, but only first 5 are considered for core ranking. However, the rest is useful for exact match scenarios. We also recommended keeping the different intent/distinct alternate questions at the top for better relevance and score.
5555

5656
Semantic understanding in custom question answering should be able to take care of similar alternate questions.
5757

58-
The return on investment will start diminishing once you exceed 10 questions. Even if you're adding more than 10 alternate questions, try to make the initial 10 questions as semantically dissimilar as possible so that all kinds of intents for the answer are captured by these 10 questions. For the project at the beginning of this section, in question answer pair #1, adding alternate questions such as "How can I buy a car", "I wanna buy a car" aren't required. Whereas adding alternate questions such as "How to purchase a car", "What are the options of buying a vehicle" can be useful.
58+
The return on investment decreases after you exceed 10 questions. Even if you include more than 10 alternate questions, focus on making the first 10 questions as semantically different as possible. By doing so, you ensure that these 10 questions capture all possible intents for the answer. For the project at the beginning of this section, in question answer pair #1, adding alternate questions such as *How can I buy a car* or *I want to buy a car* aren't required. Whereas adding alternate questions such as *How to purchase a car*, *What are the options of buying a vehicle* can be useful.
5959

6060
### When to add synonyms to a project?
6161

6262
Custom question answering provides the flexibility to use synonyms at the project level, unlike QnA Maker where synonyms are shared across projects for the entire service.
6363

64-
For better relevance, you need to provide a list of acronyms that the end user intends to use interchangeably. The following is a list of acceptable acronyms:
64+
For better relevance, you need to provide a list of acronyms that the end user intends to use interchangeably. The following list details acceptable acronyms:
6565

6666
* `MSFT` – Microsoft
6767
* `ID` – Identification
6868
* `ETA` – Estimated time of Arrival
6969

70-
Other than acronyms, if you think your words are similar in context of a particular domain and generic language models won't consider them similar, it's better to add them as synonyms. For instance, if an auto company producing a car model X receives queries such as "my car's audio isn't working" and the project has questions on "fixing audio for car X", then we need to add 'X' and 'car' as synonyms.
70+
Other than acronyms, if you think your words are similar in context of a particular domain and generic language models doesn't consider them similar, it's better to add them as synonyms. For instance, an auto company producing a car model X receives queries such as *my car's audio isn't working* and the project has questions on *fixing audio for car X*. Then, we need to add 'X' and 'car' as synonyms.
7171

72-
The transformer-based model already takes care of most of the common synonym cases, for example: `Purchase – Buy`, `Sell - Auction`, `Price – Value`. For another example, consider the following question answer pair: Q: "What is the price of Microsoft Stock?" A: "$200".
72+
The transformer-based model already takes care of most of the common synonym cases, for example: `Purchase – Buy`, `Sell - Auction`, `Price – Value`. For another example, consider the following question answer pair: Q: *What is the price of Microsoft Stock?* A: *$200*.
7373

74-
If we receive user queries like "Microsoft stock value"," Microsoft share value", "Microsoft stock worth", "Microsoft share worth", "stock value", etc., you should be able to get the correct answer even though these queries have words like "share", "value", and "worth", which aren't originally present in the project.
74+
If users ask questions like *Microsoft stock value*, *Microsoft share value*, *Microsoft stock worth*, *Microsoft share worth*, or just *stock value*, you should still be able to provide the correct answer. It's important to maintain this clarity, even though terms such as *share*, *value*, and *worth* aren't originally included in the project.
7575

76-
Special characters are not allowed in synonyms.
76+
Special characters aren't allowed in synonyms.
7777

7878
### How are lowercase/uppercase characters treated?
7979

8080
Question answering takes casing into account but it's intelligent enough to understand when it's to be ignored. You shouldn't be seeing any perceivable difference due to wrong casing.
8181

8282
### How are question answer pairs prioritized for multi-turn questions?
8383

84-
When a project has hierarchical relationships (either added manually or via extraction) and the previous response was an answer related to other question answer pairs, for the next query we give slight preference to all the children question answer pairs, sibling question answer pairs, and grandchildren question answer pairs in that order. Along with any query, the [custom question answering REST API](/rest/api/questionanswering/question-answering/get-answers) expects a `context` object with the property `previousQnAId`, which denotes the last top answer. Based on this previous `QnAID`, all the related `QnAs` are boosted.
84+
When a project includes hierarchical relationships—whether they're added manually or through extraction—special handling is applied. If the previous response addressed a question that belongs to a related set of question-answer pairs, it affects how we handle subsequent queries. For the next query, we give slight preference to all child question-answer pairs first. Preference is then given to sibling question-answer pairs, followed by grandchild question-answer pairs, in that order. Along with any query, the [custom question answering REST API](/rest/api/questionanswering/question-answering/get-answers) expects a `context` object with the property `previousQnAId`, which denotes the last top answer. Based on this previous `QnAID`, all the related `QnAs` are boosted.
8585

8686
### How are accents treated?
8787

88-
Accents are supported for all major European languages. If the query has an incorrect accent, the confidence score might be slightly different, but the service still returns the relevant answer and takes care of minor errors by leveraging fuzzy search.
88+
Accents are supported for all major European languages. If the query has an incorrect accent, the confidence score might be slightly different, but the service still returns the relevant answer and takes care of minor errors by using fuzzy search.
8989

9090
### How is punctuation in a user query treated?
9191

9292
Punctuation is ignored in a user query before sending it to the ranking stack. Ideally it shouldn't impact the relevance scores. Punctuation that is ignored is as follows: `,?:;\"'(){}[]-+。./!*؟`
9393

9494
## Chit-Chat
9595

96-
Add chit-chat to your bot, to make your bot more conversational and engaging, with low effort. You can easily add chit-chat data sources from pre-defined personalities when creating your project, and change them at any time. Learn how to [add chit-chat to your KB](../How-To/chit-chat.md).
96+
Add chit-chat to your bot, to make your bot more conversational and engaging, with low effort. You can easily add chit-chat data sources from predefined personalities when creating your project, and change them at any time. Learn how to [add chit-chat to your KB](../How-To/chit-chat.md).
9797

9898
Chit-chat is supported in [many languages](../how-to/chit-chat.md#language-support).
9999

@@ -113,15 +113,14 @@ The responses range from formal to informal and irreverent. You should select th
113113

114114
### Edit bot-specific questions
115115

116-
There are some bot-specific questions that are part of the chit-chat data set, and have been filled in with generic answers. Change these answers to best reflect your bot details.
116+
There are some bot-specific questions that are part of the chit-chat data set, and are completed with generic answers. Change these answers to best reflect your bot details.
117117

118118
We recommend making the following chit-chat question answer pairs more specific:
119119

120120
* Who are you?
121121
* What can you do?
122-
* How old are you?
122+
* What is your age?
123123
* Who created you?
124-
* Hello
125124

126125
### Adding custom chit-chat with a metadata tag
127126

@@ -135,11 +134,11 @@ The custom question answering REST API uses both questions and the answer to sea
135134

136135
Use the [`RankerType=QuestionOnly`](#choosing-ranker-type) if you don't want to search answers.
137136

138-
An example of this is when the project is a catalog of acronyms as questions with their full form as the answer. The value of the answer won't help to search for the appropriate answer.
137+
An example is when the project is a catalog of acronyms as questions with their full form as the answer. The value of the answer doesn't help to search for the appropriate answer.
139138

140139
## Ranking/Scoring
141140

142-
Make sure you're making the best use of the supported ranking features. Doing so will improve the likelihood that a given user query is answered with an appropriate response.
141+
Make sure you're making the best use of the supported ranking features. Doing so improves the likelihood that a given user query is answered with an appropriate response.
143142

144143
### Choosing a threshold
145144

@@ -151,7 +150,7 @@ By default, custom question answering searches through questions and answers. If
151150

152151
### Add alternate questions
153152

154-
Alternate questions to improve the likelihood of a match with a user query. Alternate questions are useful when there are multiple ways in which the same question may be asked. This can include changes in the sentence structure and word-style.
153+
Alternate questions to improve the likelihood of a match with a user query. Alternate questions are useful when there are multiple ways in which the same question may be asked. The alternate questions can include changes in the sentence structure and word-style.
155154

156155
|Original query|Alternate queries|Change|
157156
|--|--|--|
@@ -160,15 +159,15 @@ Alternate questions to improve the likelihood of a match with a user query. Alte
160159

161160
### Use metadata tags to filter questions and answers
162161

163-
Metadata adds the ability for a client application to know it shouldn't take all answers but instead to narrow down the results of a user query based on metadata tags. The project answer can differ based on the metadata tag, even if the query is the same. For example, *"where is parking located"* can have a different answer if the location of the restaurant branch is different - that is, the metadata is *Location: Seattle* versus *Location: Redmond*.
162+
Metadata adds the ability for a client application to know it shouldn't take all answers but instead to narrow down the results of a user query based on metadata tags. The project answer can differ based on the metadata tag, even if the query is the same. For example, the answer to *where is parking located* can vary depending on the branch location. If the metadata is *Location: Seattle*, the answer is different than if the metadata is *Location: Redmond*.
164163

165164
### Use synonyms
166165

167166
While there's some support for synonyms in the English language, use case-insensitive [word alterations](../tutorials/adding-synonyms.md) to add synonyms to keywords that take different forms.
168167

169168
|Original word|Synonyms|
170169
|--|--|
171-
|buy|purchase<br>net-banking<br>net banking|
170+
|buy|purchase<br>Net-banking<br>Net banking|
172171

173172
---
174173

@@ -183,11 +182,11 @@ For example, you might have two separate question answer pairs with the followin
183182
|where is the parking *location*|
184183
|where is the ATM *location*|
185184

186-
Since these two questions are phrased with very similar words, this similarity could cause very similar scores for many user queries that are phrased like *"where is the `<x>` location"*. Instead, try to clearly differentiate with queries like *"where is the parking lot"* and *"where is the ATM"*, by avoiding words like "location" that could be in many questions in your project.
185+
Since these two questions are phrased with similar words, this similarity could cause similar scores for many user queries that are phrased like *where is the `<x>` location*. Instead, try to clearly differentiate your queries. For example, use specific questions like *where is the parking lot* and *where is the ATM*. Avoid using general words like *location*, since they could appear in many different questions throughout your project.
187186

188187
## Collaborate
189188

190-
Custom question answering allows users to collaborate on a project. Users need access to the associated Azure resource group in order to access the projects. Some organizations may want to outsource the project editing and maintenance, and still be able to protect access to their Azure resources. This editor-approver model is done by setting up two identical language resources with identical custom question answering projects in different subscriptions and selecting one for the edit-testing cycle. Once testing is finished, the project contents are exported and transferred with an [import-export](../how-to/migrate-knowledge-base.md) process to the language resource of the approver that will finally deploy the project and update the endpoint.
189+
Custom question answering allows users to collaborate on a project. Users need access to the associated Azure resource group in order to access the projects. Some organizations may want to outsource the project editing and maintenance, and still be able to protect access to their Azure resources. This editor-approver model is done by setting up two identical language resources with identical custom question answering projects in different subscriptions and selecting one for the edit-testing cycle. Once testing is finished, the project contents are exported. They're then transferred using an [import-export](../how-to/migrate-knowledge-base.md) process. This process moves the contents to the language resource of the approver, who deploys the project and updates the endpoint.
191190

192191
## Active learning
193192

articles/ai-services/qnamaker/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ items:
146146
- name: QnA Maker 5.0 Preview 1
147147
href: /rest/api/qnamaker/alterations?view=rest-qnamaker-v5.0-preview.1&preserve-view=true
148148
- name: QnA Maker 5.0 Preview 2
149-
href: /rest/api/qnamaker/alterations?view=rest-qnamaker-v5.0-preview.2
149+
href: /rest/api/qnamaker/alterations?view=rest-qnamaker-v5.0-preview.2&preserve-view=true
150150
- name: SDKs
151151
items:
152152
- name: C#

0 commit comments

Comments
 (0)