You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/search/retriever.asciidoc
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,6 +209,11 @@ GET /index/_search
209
209
210
210
The `text_similarity_reranker` is a type of retriever that enhances search results by re-ranking documents based on semantic similarity to a specified inference text, using a machine learning model.
211
211
212
+
[TIP]
213
+
====
214
+
Refer to <<semantic-reranking>> for a high level overview of semantic reranking.
215
+
====
216
+
212
217
===== Prerequisites
213
218
214
219
To use `text_similarity_reranker` you must first set up a `rerank` task using the <<put-inference-api, Create {infer} API>>.
Copy file name to clipboardExpand all lines: docs/reference/search/search-your-data/retrievers-reranking/semantic-reranking.asciidoc
+10-19Lines changed: 10 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ preview::[]
5
5
6
6
[TIP]
7
7
====
8
-
This overview focuses more on the high-level concepts and use cases for semantic reranking. For full implementation details on how to set up and use semantic reranking in {es}, see the <<retriever,reference documentation>> in the Search API docs.
8
+
This overview focuses more on the high-level concepts and use cases for semantic reranking. For full implementation details on how to set up and use semantic reranking in {es}, see the <<text-similarity-reranker-retriever,reference documentation>> in the Search API docs.
9
9
====
10
10
11
11
Rerankers improve the relevance of results from earlier-stage retrieval mechanisms.
@@ -89,11 +89,16 @@ In {es}, semantic rerankers are implemented using the {es} <<inference-apis,Infe
89
89
90
90
To use semantic reranking in {es}, you need to:
91
91
92
-
. Choose a reranking model. In addition to cross-encoder models running on {es} inference nodes, we also expose external models and services via the Inference API to semantic rerankers.
93
-
** This includes cross-encoder models running in https://huggingface.co/inference-endpoints[HuggingFace Inference Endpoints] and the https://cohere.com/rerank[Cohere Rerank API].
94
-
. Create a `rerank` task using the <<put-inference-api,{es} Inference API>>.
92
+
. *Choose a reranking model*.
93
+
Currently you can:
94
+
95
+
** Integrate directly with the <<infer-service-cohere,Cohere Rerank inference endpoint>> using the `rerank` task type
96
+
** Integrate directly with the <<infer-service-google-vertex-ai,Google Vertex AI inference endpoint>> using the `rerank` task type
97
+
** Upload a model to {es} from Hugging Face with {eland-docs}/machine-learning.html#ml-nlp-pytorch[Eland]
98
+
*** Then set up an <<inference-example-eland,{es} service inference endpoint>> with the `rerank` task type
99
+
. *Create a `rerank` task using the <<put-inference-api,{es} Inference API>>*.
95
100
The Inference API creates an inference endpoint and configures your chosen machine learning model to perform the reranking task.
96
-
. Define a `text_similarity_reranker` retriever in your search request.
101
+
. *Define a `text_similarity_reranker` retriever in your search request*.
97
102
The retriever syntax makes it simple to configure both the retrieval and reranking of search results in a single API call.
98
103
99
104
.*Example search request* with semantic reranker
@@ -127,20 +132,6 @@ POST _search
127
132
// TEST[skip:TBD]
128
133
==============
129
134
130
-
[discrete]
131
-
[[semantic-reranking-types]]
132
-
==== Supported reranking types
133
-
134
-
The following `text_similarity_reranker` model configuration options are available.
135
-
136
-
*Text similarity with cross-encoder*
137
-
138
-
This solution uses a hosted or 3rd party inference service which relies on a cross-encoder model.
139
-
The model receives the text fields from the _top-K_ documents, as well as the search query, and calculates scores directly, which are then used to rerank the documents.
140
-
141
-
Used with the Cohere inference service rolled out in 8.13, turn on semantic reranking that works out of the box.
142
-
Check out our https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/integrations/cohere/cohere-elasticsearch.ipynb[Python notebook] for using Cohere with {es}.
0 commit comments