Skip to content

Conversation

leemthompo
Copy link
Contributor

@leemthompo leemthompo commented Nov 27, 2024

https://github.com/elastic/search-team/issues/8757

Updates:

Makes Elastic Rerank the go-to default choice for re-ranking use cases.

Follow up

  • Update ML docs to create an "Elastic Rerank" model landing page with requirements, callouts, benchmarks, etc. in the built-in models section
  • Python notebook

@leemthompo leemthompo added >docs General docs changes v6.8.17 auto-backport Automatically create backport pull requests when merged v8.18.0 labels Nov 27, 2024
@leemthompo leemthompo self-assigned this Nov 27, 2024
@github-actions
Copy link
Contributor

Documentation preview:

Copy link
Contributor

@maxhniebergall maxhniebergall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left a few suggestions for changes to this PR, and several other suggestions for improvements to this doc which don't need to be in this PR, but which I think should be done.

Comment on lines 152 to 179
[discrete]
[[inference-example-elastic-reranker]]
==== Elastic Rerank via the `elasticsearch` service

The following example shows how to create an {infer} endpoint called `my-elastic-rerank` to perform a `rerank` task type using the built-in Elastic Rerank cross-encoder model.

The API request below will automatically download the Elastic Rerank model if it isn't already downloaded and then deploy the model.
Once deployed, the model can be used for semantic re-ranking with a <<text-similarity-reranker-retriever-example-elastic-rerank,`text_similarity_reranker` retriever>>.

[source,console]
------------------------------------------------------------
PUT _inference/rerank/my-elastic-rerank
{
"service": "elasticsearch",
"service_settings": {
"model_id": ".rerank-v1", <1>
"num_threads": 1,
"adaptive_allocations": { <2>
"enabled": true,
"min_number_of_allocations": 1,
"max_number_of_allocations": 10
}
}
}
------------------------------------------------------------
// TEST[skip:TBD]
<1> The `model_id` must be the ID of the built-in Elastic Rerank model: `.rerank-v1`.
<2> {ml-docs}/ml-nlp-auto-scale.html#nlp-model-adaptive-allocations[Adaptive allocations] will be enabled with the minimum of 1 and the maximum of 10 allocations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great! Maybe we should consider making the max allocations in this example a smaller number like 2 or 4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good 👍


To use semantic re-ranking in {es}, you need to:

. *Choose a re-ranking model*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about changing the wording from "Choose a re-ranking model" to "Decide which re-ranking model to use". I think the language in this section like "Use the built-in model" will make people think it is already available (without following step 2, which is the case for our "default" models, but isn't the case for elser rerank yet. Maybe theres a better way to phrase this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely, good point 👍

===== Prerequisites

To use `text_similarity_reranker` you must first set up a `rerank` task using the <<put-inference-api, Create {infer} API>>.
The `rerank` task should be set up with a machine learning model that can compute text similarity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rerank task

we should be referring to the objects that are created with the create inference API as "endpoints" rather than "tasks". I don't think this change needs to be in this PR as many of such instances weren't created in this PR, but I think we need to open an issue to reword this across our documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to reword AMAP in these files let me know if it looks OK

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems great!


Follow these steps:

. Create an inference endpoint for the `rerank` task using the <<put-inference-api, Create {infer} API>>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case the "rerank task" refers to the task type rather than the endpoint-object, so we don't need to change this instance.

"adaptive_allocations": { <1>
"enabled": true,
"min_number_of_allocations": 1,
"max_number_of_allocations": 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once again, we may want to decrease the max allocations in this example

@leemthompo leemthompo marked this pull request as ready for review November 27, 2024 17:59
@elasticsearchmachine elasticsearchmachine added the Team:Docs Meta label for docs team label Nov 27, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

Copy link
Contributor

@maxhniebergall maxhniebergall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Liam!

@leemthompo leemthompo merged commit c3ac2bd into elastic:main Nov 28, 2024
5 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.17
8.x

leemthompo added a commit to leemthompo/elasticsearch that referenced this pull request Nov 28, 2024
leemthompo added a commit to leemthompo/elasticsearch that referenced this pull request Nov 28, 2024
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
@leemthompo leemthompo deleted the elastic-rerank-docs branch December 11, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >docs General docs changes Team:Docs Meta label for docs team v8.17.0 v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants