From 2b5e82ae4077306f66fe4cc34668b53f227a8e2a Mon Sep 17 00:00:00 2001 From: Samiul Monir Date: Wed, 16 Apr 2025 21:13:42 -0400 Subject: [PATCH 1/2] Updating documentation of text_similarity_reranker for 8.x --- .../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..2557c7604628b 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 <> cross-encoder model via a preconfigured `.rerank-v1-elasticsearch` or by creating a custom deployment 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..5d39154bfc1a3 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 is based on <> 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 <> cross-encoder model via the inference API’s {{es}} service. For an example of creating an endpoint using the Elastic Rerank model, refer to <>. * 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`) From 7c9880b853489b62144e26ef3f8f909a5950c803 Mon Sep 17 00:00:00 2001 From: Samiul Monir Date: Thu, 17 Apr 2025 09:58:19 -0400 Subject: [PATCH 2/2] updating documentation to remove duplicate and redundant wording --- docs/reference/reranking/semantic-reranking.asciidoc | 2 +- docs/reference/search/retriever.asciidoc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/reranking/semantic-reranking.asciidoc b/docs/reference/reranking/semantic-reranking.asciidoc index 2557c7604628b..d57453ac9afe7 100644 --- a/docs/reference/reranking/semantic-reranking.asciidoc +++ b/docs/reference/reranking/semantic-reranking.asciidoc @@ -85,7 +85,7 @@ 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 a preconfigured `.rerank-v1-elasticsearch` or by creating a custom deployment using 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. diff --git a/docs/reference/search/retriever.asciidoc b/docs/reference/search/retriever.asciidoc index 5d39154bfc1a3..a3cc4734fd23a 100644 --- a/docs/reference/search/retriever.asciidoc +++ b/docs/reference/search/retriever.asciidoc @@ -536,14 +536,14 @@ Refer to <> for a high level overview of semantic re-ranking ===== Prerequisites -To use `text_similarity_reranker`, you can rely on the preconfigured `.rerank-v1-elasticsearch` inference endpoint, which is based on <> and serves as the default if no `inference_id` is provided. +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 built-in <> cross-encoder model via the inference API’s {{es}} service. For an example of creating an endpoint using the Elastic Rerank model, refer to <>. +* 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.