Skip to content

Commit 52b75c5

Browse files
authored
Adds E5 model docs (#2601)
* Restructures NLP chapter and adds initial docs for E5. * [DOCS] HIghlights text. * [DOCS] Documents limitation. * [DOCS] Adds install instructions. * Fixes section IDs. * [DOCS] Fixes link. * Adds screenshots, provides install steps for trained model UI. * Adds search indices UI and dev consol install methods. * Links to HuggingFace model cards. * Adds air-gapped install link. * Removes tech preview badge. * Addresses feedback.
1 parent 30ce72f commit 52b75c5

10 files changed

+190
-4
lines changed
Loading
Loading
Loading
Loading

docs/en/stack/ml/nlp/index.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ include::ml-nlp-search-compare.asciidoc[leveloffset=+2]
66
include::ml-nlp-deploy-models.asciidoc[leveloffset=+1]
77
include::ml-nlp-inference.asciidoc[leveloffset=+1]
88
include::ml-nlp-apis.asciidoc[leveloffset=+1]
9-
include::ml-nlp-elser.asciidoc[leveloffset=+1]
9+
include::ml-nlp-built-in-models.asciidoc[leveloffset=+1]
10+
include::ml-nlp-elser.asciidoc[leveloffset=+2]
11+
include::ml-nlp-e5.asciidoc[leveloffset=+2]
12+
include::ml-nlp-lang-ident.asciidoc[leveloffset=+2]
1013
include::ml-nlp-model-ref.asciidoc[leveloffset=+1]
1114
include::ml-nlp-examples.asciidoc[leveloffset=+1]
1215
include::ml-nlp-ner-example.asciidoc[leveloffset=+2]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[[ml-nlp-built-in-models]]
2+
= Built-in NLP models
3+
4+
There are {nlp} models that are available for use in every cluster
5+
out-of-the-box. These models are pre-trained which means they don't require
6+
fine-tuning on your own data, making it adaptable for various use cases out of
7+
the box. The following models are available:
8+
9+
* <<ml-nlp-elser>> trained by Elastic
10+
* <<ml-nlp-e5>>
11+
* <<ml-nlp-lang-ident>>

docs/en/stack/ml/nlp/ml-nlp-classify-text.asciidoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ label unstructured input text:
1313
* <<ml-nlp-text-classification>>
1414
* <<ml-nlp-zero-shot>>
1515

16-
include::ml-nlp-lang-ident.asciidoc[]
16+
17+
[discrete]
18+
== {lang-ident-cap}
19+
20+
The {lang-ident} model is provided out-of-the box in your {es} cluster. You can
21+
find the documentation of the model on the <<ml-nlp-lang-ident>> page under the
22+
Built-in models section.
1723

1824

1925
[discrete]
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
[[ml-nlp-e5]]
2+
= E5 – EmbEddings from bidirEctional Encoder rEpresentations
3+
++++
4+
<titleabbrev>E5</titleabbrev>
5+
++++
6+
7+
:frontmatter-description: E5 is a multilingual dense vector model.
8+
:frontmatter-tags-products: [ml]
9+
:frontmatter-tags-content-type: [how-to]
10+
:frontmatter-tags-user-goals: [analyze]
11+
12+
EmbEddings from bidirEctional Encoder rEpresentations - or E5 - is a {nlp}
13+
model that enables you to perform multi-lingual semantic search by using dense
14+
vector representations. This model is recommended for non-English language
15+
documents and queries. If you want to perform semantic search on English
16+
language documents, use the <<ml-nlp-elser>> model.
17+
18+
{ref}/semantic-search.html[Semantic search] provides you search results based on
19+
contextual meaning and user intent, rather than exact keyword matches.
20+
21+
E5 has two versions: one cross-platform version which runs on any hardware
22+
and one version which is optimized for Intel® silicon. The
23+
**Model Management** > **Trained Models** page shows you which version of E5 is
24+
recommended to deploy based on your cluster's hardware.
25+
26+
The supported model version of E5 is `multilingual-e5-small`, refer to
27+
<<ml-nlp-e5-limit, this page>> for more information.
28+
29+
Refer to the model cards of the
30+
https://huggingface.co/elastic/multilingual-e5-small[multilingual-e5-small] and
31+
the
32+
https://huggingface.co/elastic/multilingual-e5-small-optimized[multilingual-e5-small-optimized]
33+
models on HuggingFace for further information including licensing.
34+
35+
36+
[discrete]
37+
[[e5-req]]
38+
== Requirements
39+
40+
To use E5, you must have the {subscriptions}[appropriate subscription] level
41+
for semantic search or the trial period activated.
42+
43+
44+
[discrete]
45+
[[download-deploy-e5]]
46+
== Download and deploy E5
47+
48+
You can download and deploy the E5 model either from
49+
**{ml-app}** > **Trained Models**, from **Search** > **Indices**, or by using
50+
the Dev Console.
51+
52+
53+
[discrete]
54+
[[trained-model-e5]]
55+
=== Using the Trained Models page
56+
57+
1. In {kib}, navigate to **{ml-app}** > **Trained Models**. E5 can be found in
58+
the list of trained models. There are two versions available: one portable
59+
version which runs on any hardware and one version which is optimized for Intel®
60+
silicon. You can see which model is recommended to use based on your hardware
61+
configuration.
62+
2. Click the **Add trained model** button. Select the E5 model version you want
63+
to use in the opening modal window. The model that is recommended for you based
64+
on your hardware configuration is highlighted. Click **Download**. You can check
65+
the download status on the **Notifications** page.
66+
+
67+
--
68+
[role="screenshot"]
69+
image::images/ml-nlp-e5-download.png[alt="Downloading E5",align="center"]
70+
--
71+
+
72+
--
73+
Alternatively, click the **Download model** button under **Actions** in the
74+
trained model list.
75+
--
76+
3. After the download is finished, start the deployment by clicking the
77+
**Start deployment** button.
78+
4. Provide a deployment ID, select the priority, and set the number of
79+
allocations and threads per allocation values.
80+
+
81+
--
82+
[role="screenshot"]
83+
image::images/ml-nlp-deployment-id-e5.png[alt="Deploying ELSER",align="center"]
84+
--
85+
5. Click Start.
86+
87+
88+
[discrete]
89+
[[elasticsearch-e5]]
90+
=== Using the search indices UI
91+
92+
Alternatively, you can download and deploy the E5 model to an {infer} pipeline
93+
using the search indices UI.
94+
95+
1. In {kib}, navigate to **Search** > **Indices**.
96+
2. Select the index from the list that has an {infer} pipeline in which you want
97+
to use E5.
98+
3. Navigate to the **Pipelines** tab.
99+
4. Under **{ml-app} {infer-cap} Pipelines**, click the **Deploy** button in the
100+
**Improve your results with E5** section to begin downloading the E5 model. This
101+
may take a few minutes depending on your network.
102+
+
103+
--
104+
[role="screenshot"]
105+
image::images/ml-nlp-deploy-e5-es.png[alt="Deploying E5 in Elasticsearch",align="center"]
106+
--
107+
5. Once the model is downloaded, click the **Start single-threaded** button to
108+
start the model with basic configuration or select the **Fine-tune performance**
109+
option to navigate to the **Trained Models** page where you can configure the
110+
model deployment.
111+
+
112+
--
113+
[role="screenshot"]
114+
image::images/ml-nlp-start-e5-es.png[alt="Start E5 in Elasticsearch",align="center"]
115+
--
116+
117+
When your E5 model is deployed and started, it is ready to be used in a
118+
pipeline.
119+
120+
121+
[discrete]
122+
[[dev-console-e5]]
123+
=== Using the Dev Console
124+
125+
1. In {kib}, navigate to the **Dev Console**.
126+
2. Create the E5 model configuration by running the following API call:
127+
+
128+
--
129+
[source,console]
130+
----------------------------------
131+
PUT _ml/trained_models/.multilingual-e5-small
132+
{
133+
"input": {
134+
"field_names": ["text_field"]
135+
}
136+
}
137+
----------------------------------
138+
139+
The API call automatically initiates the model download if the model is not
140+
downloaded yet.
141+
--
142+
3. Deploy the model by using the
143+
{ref}/start-trained-model-deployment.html[start trained model deployment API]
144+
with a delpoyment ID:
145+
+
146+
--
147+
[source,console]
148+
----------------------------------
149+
POST _ml/trained_models/.multilingual-e5-small/deployment/_start?deployment_id=for_search
150+
----------------------------------
151+
--
152+
153+
[discrete]
154+
[[air-gapped-install-e5]]
155+
== Deploy the E5 model in an air-gapped environment
156+
157+
If you want to deploy the E5 model in a restricted or closed network, follow the
158+
instructions
159+
https://www.elastic.co/guide/en/elasticsearch/client/eland/current/machine-learning.html#ml-nlp-pytorch-air-gapped[in the Eland client documentation].

docs/en/stack/ml/nlp/ml-nlp-lang-ident.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
[discrete]
21
[[ml-nlp-lang-ident]]
3-
== {lang-ident-cap}
2+
= {lang-ident-cap}
43

54
{lang-ident-cap} enables you to determine the language of text.
65

docs/en/stack/ml/nlp/ml-nlp-limitations.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ each field of the ingested documents that ELSER is applied to are taken into
1818
account for the search process. If your data set contains long documents, divide
1919
them into smaller segments before ingestion if you need the full text to be
2020
searchable.
21+
22+
23+
[discrete]
24+
[[ml-nlp-e5-limit]]
25+
== The `multilingual-e5-small` model is supported
26+
27+
From the list of E5 models, currently only the `multilingual-e5-small` is
28+
supported.

0 commit comments

Comments
 (0)