You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 [ELSER](ml-nlp-elser.md) model.
13
10
14
11
[Semantic search](../../../solutions/search/semantic-search.md) provides you search results based on contextual meaning and user intent, rather than exact keyword matches.
@@ -17,23 +14,21 @@ E5 has two versions: one cross-platform version which runs on any hardware and o
17
14
18
15
Refer to the model cards of the [multilingual-e5-small](https://huggingface.co/elastic/multilingual-e5-small) and the [multilingual-e5-small-optimized](https://huggingface.co/elastic/multilingual-e5-small-optimized) models on HuggingFace for further information including licensing.
19
16
20
-
21
17
## Requirements [e5-req]
22
18
23
19
To use E5, you must have the [appropriate subscription](https://www.elastic.co/subscriptions) level for semantic search or the trial period activated.
24
20
25
21
Enabling trained model autoscaling for your E5 deployment is recommended. Refer to [*Trained model autoscaling*](ml-nlp-auto-scale.md) to learn more.
26
22
27
-
28
23
## Download and deploy E5 [download-deploy-e5]
29
24
30
25
The easiest and recommended way to download and deploy E5 is to use the [{{infer}} API](https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-apis.html).
31
26
32
27
1. In {{kib}}, navigate to the **Dev Console**.
33
28
2. Create an {{infer}} endpoint with the `elasticsearch` service by running the following API request:
34
29
35
-
```console
36
-
PUT _inference/text_embedding/my-e5-model
30
+
```console
31
+
PUT _inference/text_embedding/my-e5-model
37
32
{
38
33
"service": "elasticsearch",
39
34
"service_settings": {
@@ -42,16 +37,14 @@ The easiest and recommended way to download and deploy E5 is to use the [{{infer
42
37
"model_id": ".multilingual-e5-small"
43
38
}
44
39
}
45
-
```
40
+
```
46
41
47
42
The API request automatically initiates the model download and then deploy the model.
48
43
49
-
50
44
Refer to the [`elasticsearch` {{infer}} service documentation](../../../solutions/search/inference-api/elasticsearch-inference-integration.md) to learn more about the available settings.
51
45
52
46
After you created the E5 {{infer}} endpoint, it’s ready to be used for semantic search. The easiest way to perform semantic search in the {{stack}} is to [follow the `semantic_text` workflow](../../../solutions/search/semantic-search/semantic-search-semantic-text.md).
53
47
54
-
55
48
### Alternative methods to download and deploy E5 [alternative-download-deploy-e5]
56
49
57
50
You can also download and deploy the E5 model either from **{{ml-app}}** > **Trained Models**, from **Search** > **Indices**, or by using the trained models API in Dev Console.
@@ -60,7 +53,6 @@ You can also download and deploy the E5 model either from **{{ml-app}}** > **Tra
60
53
For most cases, the preferred version is the **Intel and Linux optimized** model, it is recommended to download and deploy that version.
61
54
::::
62
55
63
-
64
56
::::{dropdown} Using the Trained Models page
65
57
66
58
#### Using the Trained Models page [trained-model-e5]
@@ -87,7 +79,6 @@ For most cases, the preferred version is the **Intel and Linux optimized** model
87
79
88
80
::::
89
81
90
-
91
82
::::{dropdown} Using the search indices UI
92
83
93
84
#### Using the search indices UI [elasticsearch-e5]
@@ -111,65 +102,61 @@ Alternatively, you can download and deploy the E5 model to an {{infer}} pipeline
111
102
:class: screenshot
112
103
:::
113
104
114
-
115
105
When your E5 model is deployed and started, it is ready to be used in a pipeline.
116
106
117
107
::::
118
108
119
-
120
109
::::{dropdown} Using the trained models API in Dev Console
121
110
122
111
#### Using the trained models API in Dev Console [dev-console-e5]
123
112
124
113
1. In {{kib}}, navigate to the **Dev Console**.
125
114
2. Create the E5 model configuration by running the following API call:
126
115
127
-
```console
128
-
PUT _ml/trained_models/.multilingual-e5-small
116
+
```console
117
+
PUT _ml/trained_models/.multilingual-e5-small
129
118
{
130
119
"input": {
131
120
"field_names": ["text_field"]
132
121
}
133
122
}
134
-
```
123
+
```
135
124
136
125
The API call automatically initiates the model download if the model is not downloaded yet.
137
126
138
127
3. Deploy the model by using the [start trained model deployment API](https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trained-model-deployment.html) with a delpoyment ID:
139
128
140
-
```console
141
-
POST _ml/trained_models/.multilingual-e5-small/deployment/_start?deployment_id=for_search
142
-
```
143
-
129
+
```console
130
+
POST _ml/trained_models/.multilingual-e5-small/deployment/_start?deployment_id=for_search
131
+
```
144
132
145
133
::::
146
134
147
-
148
-
149
135
## Deploy the E5 model in an air-gapped environment [air-gapped-install-e5]
150
136
151
-
If you want to install E5 in an air-gapped environment, you have the following options: * put the model artifacts into a directory inside the config directory on all master-eligible nodes (for `multilingual-e5-small` and `multilingual-e5-small-linux-x86-64`) * install the model by using HuggingFace (for `multilingual-e5-small` model only).
137
+
If you want to install E5 in an air-gapped environment, you have the following options:
152
138
139
+
* put the model artifacts into a directory inside the config directory on all master-eligible nodes (for `multilingual-e5-small` and `multilingual-e5-small-linux-x86-64`)
140
+
* install the model by using HuggingFace (for `multilingual-e5-small` model only).
153
141
154
142
### Model artifact files [e5-model-artifacts]
155
143
156
144
For the `multilingual-e5-small` model, you need the following files in your system:
@@ -190,7 +177,6 @@ For a file-based access, follow these steps:
190
177
9. Provide a deployment ID, select the priority, and set the number of allocations and threads per allocation values.
191
178
10. Click **Start**.
192
179
193
-
194
180
### Using the HuggingFace repository [_using_the_huggingface_repository]
195
181
196
182
You can install the `multilingual-e5-small` model in a restricted or closed network by pointing the `eland_import_hub_model` script to the model’s local files.
@@ -230,8 +216,6 @@ For an offline install, the model first needs to be cloned locally, Git and [Git
230
216
231
217
Once it’s uploaded to {{es}}, the model will have the ID specified by `--es-model-id`. If it is not set, the model ID is derived from `--hub-model-id`; spaces and path delimiters are converted to double underscores `__`.
232
218
233
-
234
-
235
219
## Disclaimer [terms-of-use-e5]
236
220
237
221
Customers may add third party trained models for management in Elastic. These models are not owned by Elastic. While Elastic will support the integration with these models in the performance according to the documentation, you understand and agree that Elastic has no control over, or liability for, the third party models or the underlying training data they may utilize.
0 commit comments