-
Notifications
You must be signed in to change notification settings - Fork 256
Adds E5 model docs #2601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Adds E5 model docs #2601
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5c026bd
Restructures NLP chapter and adds initial docs for E5.
szabosteve 5de8afb
[DOCS] HIghlights text.
szabosteve ac8d193
[DOCS] Documents limitation.
szabosteve d955a63
[DOCS] Adds install instructions.
szabosteve fd105c7
Fixes section IDs.
szabosteve 37c07f7
[DOCS] Fixes link.
szabosteve d2b211f
Adds screenshots, provides install steps for trained model UI.
szabosteve 156bc2a
Adds search indices UI and dev consol install methods.
szabosteve fd8863c
Links to HuggingFace model cards.
szabosteve 773cf31
Adds air-gapped install link.
szabosteve 28e8f2c
Removes tech preview badge.
szabosteve 790c989
Addresses feedback.
szabosteve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[[ml-nlp-built-in-models]] | ||
= Built-in NLP models | ||
|
||
There are {nlp} models that are available for use in every cluster | ||
out-of-the-box. These models are pre-trained which means they don't require | ||
fine-tuning on your own data, making it adaptable for various use cases out of | ||
the box. The following models are available: | ||
|
||
* <<ml-nlp-elser>> trained by Elastic | ||
* <<ml-nlp-e5>> | ||
* <<ml-nlp-lang-ident>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
[[ml-nlp-e5]] | ||
= E5 – EmbEddings from bidirEctional Encoder rEpresentations | ||
++++ | ||
<titleabbrev>E5</titleabbrev> | ||
++++ | ||
|
||
:frontmatter-description: E5 is a multilingual dense vector model. | ||
:frontmatter-tags-products: [ml] | ||
:frontmatter-tags-content-type: [how-to] | ||
:frontmatter-tags-user-goals: [analyze] | ||
|
||
EmbEddings from bidirEctional Encoder rEpresentations - or E5 - is a {nlp} | ||
model that enables you to perform multi-lingual semantic search by using dense | ||
vector representations. This model is recommended for non-English language | ||
documents and queries. If you want to perform semantic search on English | ||
language documents, use the <<ml-nlp-elser>> model. | ||
|
||
{ref}/semantic-search.html[Semantic search] provides you search results based on | ||
contextual meaning and user intent, rather than exact keyword matches. | ||
|
||
E5 has two versions: one cross-platform version which runs on any hardware | ||
and one version which is optimized for Intel® silicon. The | ||
**Model Management** > **Trained Models** page shows you which version of E5 is | ||
recommended to deploy based on your cluster's hardware. | ||
|
||
The supported model version of E5 is `multilingual-e5-small`, refer to | ||
<<ml-nlp-e5-limit, this page>> for more information. | ||
|
||
Refer to the model cards of the | ||
https://huggingface.co/elastic/multilingual-e5-small[multilingual-e5-small] and | ||
the | ||
https://huggingface.co/elastic/multilingual-e5-small-optimized[multilingual-e5-small-optimized] | ||
models on HuggingFace for further information including licensing. | ||
|
||
|
||
[discrete] | ||
[[e5-req]] | ||
== Requirements | ||
|
||
To use E5, you must have the {subscriptions}[appropriate subscription] level | ||
for semantic search or the trial period activated. | ||
|
||
|
||
[discrete] | ||
[[download-deploy-e5]] | ||
== Download and deploy E5 | ||
|
||
You can download and deploy the E5 model either from | ||
**{ml-app}** > **Trained Models**, from **Search** > **Indices**, or by using | ||
the Dev Console. | ||
|
||
|
||
[discrete] | ||
[[trained-model-e5]] | ||
=== Using the Trained Models page | ||
|
||
1. In {kib}, navigate to **{ml-app}** > **Trained Models**. E5 can be found in | ||
the list of trained models. There are two versions available: one portable | ||
version which runs on any hardware and one version which is optimized for Intel® | ||
silicon. You can see which model is recommended to use based on your hardware | ||
configuration. | ||
2. Click the **Add trained model** button. Select the E5 model version you want | ||
to use in the opening modal window. The model that is recommended for you based | ||
on your hardware configuration is highlighted. Click **Download**. You can check | ||
the download status on the **Notifications** page. | ||
+ | ||
-- | ||
[role="screenshot"] | ||
image::images/ml-nlp-e5-download.png[alt="Downloading E5",align="center"] | ||
-- | ||
+ | ||
-- | ||
Alternatively, click the **Download model** button under **Actions** in the | ||
trained model list. | ||
-- | ||
3. After the download is finished, start the deployment by clicking the | ||
**Start deployment** button. | ||
4. Provide a deployment ID, select the priority, and set the number of | ||
allocations and threads per allocation values. | ||
+ | ||
-- | ||
[role="screenshot"] | ||
image::images/ml-nlp-deployment-id-e5.png[alt="Deploying ELSER",align="center"] | ||
-- | ||
5. Click Start. | ||
|
||
|
||
[discrete] | ||
[[elasticsearch-e5]] | ||
=== Using the search indices UI | ||
|
||
Alternatively, you can download and deploy the E5 model to an {infer} pipeline | ||
using the search indices UI. | ||
|
||
1. In {kib}, navigate to **Search** > **Indices**. | ||
2. Select the index from the list that has an {infer} pipeline in which you want | ||
to use E5. | ||
3. Navigate to the **Pipelines** tab. | ||
4. Under **{ml-app} {infer-cap} Pipelines**, click the **Deploy** button in the | ||
**Improve your results with E5** section to begin downloading the E5 model. This | ||
may take a few minutes depending on your network. | ||
+ | ||
-- | ||
[role="screenshot"] | ||
image::images/ml-nlp-deploy-e5-es.png[alt="Deploying E5 in Elasticsearch",align="center"] | ||
-- | ||
5. Once the model is downloaded, click the **Start single-threaded** button to | ||
start the model with basic configuration or select the **Fine-tune performance** | ||
option to navigate to the **Trained Models** page where you can configure the | ||
model deployment. | ||
+ | ||
-- | ||
[role="screenshot"] | ||
image::images/ml-nlp-start-e5-es.png[alt="Start E5 in Elasticsearch",align="center"] | ||
-- | ||
|
||
When your E5 model is deployed and started, it is ready to be used in a | ||
pipeline. | ||
|
||
|
||
[discrete] | ||
[[dev-console-e5]] | ||
=== Using the Dev Console | ||
|
||
1. In {kib}, navigate to the **Dev Console**. | ||
2. Create the E5 model configuration by running the following API call: | ||
+ | ||
-- | ||
[source,console] | ||
---------------------------------- | ||
PUT _ml/trained_models/.multilingual-e5-small | ||
{ | ||
"input": { | ||
"field_names": ["text_field"] | ||
} | ||
} | ||
---------------------------------- | ||
|
||
The API call automatically initiates the model download if the model is not | ||
downloaded yet. | ||
-- | ||
3. Deploy the model by using the | ||
{ref}/start-trained-model-deployment.html[start trained model deployment API] | ||
with a delpoyment ID: | ||
+ | ||
-- | ||
[source,console] | ||
---------------------------------- | ||
POST _ml/trained_models/.multilingual-e5-small/deployment/_start?deployment_id=for_search | ||
---------------------------------- | ||
-- | ||
|
||
[discrete] | ||
[[air-gapped-install-e5]] | ||
== Deploy the E5 model in an air-gapped environment | ||
|
||
If you want to deploy the E5 model in a restricted or closed network, follow the | ||
instructions | ||
https://www.elastic.co/guide/en/elasticsearch/client/eland/current/machine-learning.html#ml-nlp-pytorch-air-gapped[in the Eland client documentation]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.