Skip to content

Commit 79aa1ed

Browse files
committed
Hiding relevance tuning based on APIs not yet available
1 parent e332aac commit 79aa1ed

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

articles/search/tutorial-rag-build-solution-maximize-relevance.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,26 @@ ms.date: 10/05/2024
1414

1515
# Tutorial: Maximize relevance (RAG in Azure AI Search)
1616

17-
In this tutorial, learn how to improve the relevance of search results used in RAG solutions. Relevance tuning can be an important factor in delivering a RAG solution that meets user expectations. In Azure AI Search, relevance tuning includes L2 semantic ranking, scoring profiles, vector query weighting and minimum thresholds, and other options.
17+
In this tutorial, learn how to improve the relevance of search results used in RAG solutions. Relevance tuning can be an important factor in delivering a RAG solution that meets user expectations. In Azure AI Search, relevance tuning includes L2 semantic ranking and scoring profiles.
1818

19-
To implement some of these technqiues, you revisit the index schema to add configurations for semantic ranking and scoring profiles. Other relevance tuning techniques apply to the queries themselves.
19+
To implement some of these techniques, you revisit the index schema to add configurations for semantic ranking and scoring profiles. Other relevance tuning techniques can be applied to the queries themselves.
2020

2121
In this tutorial, you modify the existing search index and queries to use:
2222

2323
> [!div class="checklist"]
2424
> - L2 semantic ranking
2525
> - Scoring profile for document boosting
26-
> - Vector weighting
27-
> - Minimum thresholds on vector results
2826
29-
This tutorial updates the search index created by the [indexing pipeline](tutorial-rag-build-solution-pipeline.md). Updates don't affect the existing content, so no rebuild is necessary and you won't need to rerun the indexer.
27+
This tutorial updates the search index created by the [indexing pipeline](tutorial-rag-build-solution-pipeline.md). Updates don't affect the existing content, so no rebuild is necessary and you don't need to rerun the indexer.
28+
29+
> [!NOTE]
30+
> There are more relevance features in preview, including vector query weighting and setting minimum thresholds, but we omit them from this tutorial becaues they aren't yet available in the Azure SDK for Python.
3031
3132
## Prerequisites
3233

3334
- [Visual Studio Code](https://code.visualstudio.com/download) with the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) and the [Jupyter package](https://pypi.org/project/jupyter/).
3435

35-
- [Azure AI Search](search-create-service-portal.md), Basic tier or above for managed identity and semantic ranking, in the same region as Azure OpenAI and Azure AI Services.
36+
- [Azure AI Search](search-create-service-portal.md), Basic tier or higher for managed identity and semantic ranking, in the same region as Azure OpenAI and Azure AI Services.
3637

3738
- [Azure OpenAI](/azure/ai-services/openai/how-to/create-resource), with a deployment of text-embedding-002 and gpt-35-turbo, in the same region as Azure AI Search.
3839

@@ -189,16 +190,25 @@ response = openai_client.chat.completions.create(
189190
print(response.choices[0].message.content)
190191
```
191192

192-
## Update queries for minimum thresholds
193+
<!-- ## Update queries for minimum thresholds ** NOT AVAILABLE IN PYTHON SDK
193194

194-
Keyword search only returns results if there's match found in the index, up to a maximum of 50 results by default. In contrast, vector search returns *k*-results every time, even if the matching vectors aren't a close match.
195+
Keyword search only returns results if there's match found in the index, up to a maximum of 50 results by default. In contrast, vector search returns `k`-results every time, even if the matching vectors aren't a close match.
195196

196-
Using preview features, you can unpack a hybrid search score to review the individual component scores. Based on that information, you can set minimum thresholds to exclude any match that falls below it.
197+
In the vector query portion of the request, add a threshold object and set a minimum value for including vector matches in the results.
197198

198-
## Update queries for vector weighting
199+
Vector scores range from 0.333 to 1.00. For more information, see [Set thresholds to exclude low-scoring results](vector-search-how-to-query.md#set-thresholds-to-exclude-low-scoring-results-preview) and [Scores in a vector search results](vector-search-ranking.md#scores-in-a-vector-search-results).
199200

200-
Semantic ranking and scoring profiles operate on nonvector content, but you can tune the vector portion of a hybrid query to amplify or diminish its importance based on how much value it adds to the results. For example, if you run keyword search and vector search independently and find that one of them is outperforming the other, you can adjust the weight on the vector side to higher or lower. This approach gives you more control over query processing.
201+
```python
202+
# Update the vector_query to include a minimum threshold.
203+
query="how much of earth is covered by water"
204+
vector_query = VectorizableTextQuery(text=query, k_nearest_neighbors=1, fields="text_vector", threshold.kind="vectorSImiliarty", threshold.value=0.8, exhaustive=True) -->
201205

206+
<!-- ## Update queries for vector weighting
207+
208+
<!-- Using preview features, you can unpack a hybrid search score to review the individual component scores. Based on that information, you can set minimum thresholds to exclude any match that falls below it.
209+
210+
Semantic ranking and scoring profiles operate on nonvector content, but you can tune the vector portion of a hybrid query to amplify or diminish its importance based on how much value it adds to the results. For example, if you run keyword search and vector search independently and find that one of them is outperforming the other, you can adjust the weight on the vector side to higher or lower. This approach gives you more control over query processing.
211+
-->
202212

203213
<!-- Key points:
204214

0 commit comments

Comments
 (0)