From 8bbd254231cab13822a413b4d3e7a59bb9743482 Mon Sep 17 00:00:00 2001 From: Samiul Monir <150824886+Samiul-TheSoccerFan@users.noreply.github.com> Date: Thu, 17 Apr 2025 10:53:50 -0400 Subject: [PATCH] Updating documentation for text_similarity_reranker for 8.x (#126971) * Updating documentation of text_similarity_reranker for 8.x * updating documentation to remove duplicate and redundant wording --- .../reference/reranking/semantic-reranking.asciidoc | 8 +++----- docs/reference/search/retriever.asciidoc | 13 +++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/reference/reranking/semantic-reranking.asciidoc b/docs/reference/reranking/semantic-reranking.asciidoc index e1e2abd224a8e..d57453ac9afe7 100644 --- a/docs/reference/reranking/semantic-reranking.asciidoc +++ b/docs/reference/reranking/semantic-reranking.asciidoc @@ -1,8 +1,6 @@ [[semantic-reranking]] == Semantic re-ranking -preview::[] - [TIP] ==== This overview focuses more on the high-level concepts and use cases for semantic re-ranking. For full implementation details on how to set up and use semantic re-ranking in {es}, see the <> in the Search API docs. @@ -87,11 +85,11 @@ To use semantic re-ranking in {es}, you need to: . *Select and configure a re-ranking model*. You have the following options: -.. Use the <> cross-encoder model via the inference API's {es} service. +.. Use the <> model through a preconfigured `.rerank-v1-elasticsearch` endpoint or create a custom one using the inference API's {es} service. .. Use the <> to create a `rerank` endpoint. .. Use the <> to create a `rerank` endpoint. .. Upload a model to {es} from Hugging Face with {eland-docs}/machine-learning.html#ml-nlp-pytorch[Eland]. You'll need to use the `text_similarity` NLP task type when loading the model using Eland. Then set up an <> with the `rerank` endpoint type. -+ ++ Refer to {ml-docs}/ml-nlp-model-ref.html#ml-nlp-model-ref-text-similarity[the Elastic NLP model reference] for a list of third party text similarity models supported by {es} for semantic re-ranking. . *Create a `rerank` endpoint using the <>*. @@ -137,4 +135,4 @@ POST _search * Read the <> for syntax and implementation details * Learn more about the <> abstraction * Learn more about the Elastic <> -* Check out our https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/integrations/cohere/cohere-elasticsearch.ipynb[Python notebook] for using Cohere with {es} \ No newline at end of file +* Check out our https://github.com/elastic/elasticsearch-labs/blob/main/notebooks/integrations/cohere/cohere-elasticsearch.ipynb[Python notebook] for using Cohere with {es} diff --git a/docs/reference/search/retriever.asciidoc b/docs/reference/search/retriever.asciidoc index 2c8ef618dfa00..a3cc4734fd23a 100644 --- a/docs/reference/search/retriever.asciidoc +++ b/docs/reference/search/retriever.asciidoc @@ -536,13 +536,14 @@ Refer to <> for a high level overview of semantic re-ranking ===== Prerequisites -To use `text_similarity_reranker` you must first set up an inference endpoint for the `rerank` task using the <>. -The endpoint should be set up with a machine learning model that can compute text similarity. -Refer to {ml-docs}/ml-nlp-model-ref.html#ml-nlp-model-ref-text-similarity[the Elastic NLP model reference] for a list of third-party text similarity models supported by {es}. +To use `text_similarity_reranker`, you can rely on the preconfigured `.rerank-v1-elasticsearch` inference endpoint, which uses the <> and serves as the default if no `inference_id` is provided. +This model is optimized for reranking based on text similarity. If you'd like to use a different model, you can set up a custom inference endpoint for the `rerank` task using the <>. +The endpoint should be configured with a machine learning model capable of computing text similarity. +Refer to {ml-docs}/ml-nlp-model-ref.html#ml-nlp-model-ref-text-similarity[the Elastic NLP model reference] for a list of third-party text similarity models supported by {{es}}. You have the following options: -* Use the the built-in <> cross-encoder model via the inference API's {es} service. +* Use the built-in Elastic Rerank cross-encoder model via the inference API’s {{es}} service. See <> for creating an endpoint using the Elastic Rerank model. * Use the <> with the `rerank` task type. * Use the <> with the `rerank` task type. * Upload a model to {es} with {eland-docs}/machine-learning.html#ml-nlp-pytorch[Eland] using the `text_similarity` NLP task type. @@ -582,9 +583,9 @@ The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the `inferenceText`. `inference_id`:: -(Required, `string`) +(Optional, `string`) + -Unique identifier of the inference endpoint created using the {infer} API. +Unique identifier of the inference endpoint created using the {infer} API. If you don’t specify an inference endpoint, the `inference_id` field defaults to `.rerank-v1-elasticsearch`, a preconfigured endpoint for the elasticsearch `.rerank-v1` model. `inference_text`:: (Required, `string`)