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
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ This repository contains executable Python notebooks, sample apps, and resources
8
8
9
9
# Python notebooks 📒
10
10
11
-
The [`notebooks` folder](notebooks/README.md) contains a range of executable Python notebooks, so you can test these features out for yourself. Colab provides an easy-to-use Python virtual environment in the browser.
11
+
The [`notebooks`](notebooks/README.md) folder contains a range of executable Python notebooks, so you can test these features out for yourself. Colab provides an easy-to-use Python virtual environment in the browser.
Copy file name to clipboardExpand all lines: example-apps/relevance-workbench/README.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,24 @@
1
1
# Relevance workbench
2
2
3
-
This application allows you to compare results ranking between the ELSER model and BM25.
3
+
This application allows you to compare results ranking between the [Elastic Learned Sparse EncodeR](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html)model and BM25.
You can also try with your own data by forking this repo and plugging the application to your own Elasticsearch deployment.
7
+
You can also try with your own data by forking this repo and plugging the application into your own Elasticsearch deployment.
8
8
9
9
# Deploy with default dataset
10
10
11
11
## Pre-requisites
12
12
13
-
To run this demo successfully, you will need an Elasticsearch deployment (> 8.8) with the ELSER model deployed. The easiest way for this is to use Elastic Cloud as described in the next part but you can also deploy Elasticsearch locally.
13
+
To run this demo successfully, you will need an Elasticsearch deployment (> 8.8) with the ELSER model deployed. The easiest way for this is to use Elastic Cloud as described in the next part but you can also deploy Elasticsearch locally.
14
14
15
15
## Deploy Elasticsearch in Elastic Cloud
16
16
17
17
If you don't have an Elastic Cloud account, you can start by signing up for a [free Elastic Cloud trial](https://cloud.elastic.co/registration). After creating an account, you’ll have an active subscription, and you’ll be prompted to create your first deployment.
18
18
19
19
Follow the steps to Create a new deployment. For more details, refer to [Create a deployment](https://www.elastic.co/guide/en/cloud/current/ec-create-deployment.html) in the Elastic Cloud documentation.
20
20
21
-
For that demo, you will need to have an Elasticsearch deployment with Enterprise Search enabled and a ML node with at least 4Gb of memory.
21
+
For that demo, you will need to have an Elasticsearch deployment with Enterprise Search enabled and a ML node with at least 4Gb of memory.
22
22
23
23
Once created don't forget to save the default admin password in a safe place.
24
24
@@ -32,23 +32,23 @@ You can follow this [documentation](https://www.elastic.co/guide/en/machine-lear
32
32
33
33
The best approach is to use Enterprise Search to create a new index and configure the ingest pipeline to enrich the data.
34
34
35
-
From the landing page in Kibana, navigate to Enterprise Search.
35
+
From the landing page in Kibana, navigate to Enterprise Search.
Here, click on Create an Elasticsearch index and choose the API method.
41
+
Here, click on Create an Elasticsearch index and choose the API method.
42
42
43
-
Name the index `search-movies` (notice the existing prefix `search-`), and click on Create index.
43
+
Name the index `search-movies` (notice the existing prefix `search-`), and click on Create index.
44
44
45
45
### Configure the ingest pipeline
46
46
47
47
On the index configuration screen, navigate to the Pipelines tab and click on Copy and customize.
48
48
49
49

50
50
51
-
Now click on Add Inference pipeline to configure the inference pipeline.
51
+
Now click on Add Inference pipeline to configure the inference pipeline.
52
52
53
53
Name the inference pipeline `ml-inference-movies` (notice the existing prefix `ml-inference-`) and select the ELSER model. If it's not available, you can deploy it on the previous screen. Click continue.
54
54
@@ -58,15 +58,15 @@ On the next screen, add the fields `overview` and `title` as custom options.
Click Continue to review the changes and then Create pipeline.
65
+
Click Continue to review the changes and then Create pipeline.
66
66
67
67
### Run the script to ingest data
68
68
69
-
Go to the folder `data` and run the python script `index-data.py` to ingest the movies dataset.
69
+
Go to the folder `data` and run the python script `index-data.py` to ingest the movies dataset.
70
70
71
71
In order to connect it to the correct Elastic Cloud instance, we need the default admin password you saved after creating the deployment and the Cloud ID for your deployment.
- ELASTICSEARCH_PASSWORD: Use the default admin password previously saved
88
88
- CLOUD_ID: See instructions above to retrieve it
89
89
90
-
Note that by default, only subset of the dataset (100 movies) is indexed. If you're interested in indexing the whole data (7918 movies), you can select the `movies.json.gz` file by adding the option `--gzip_file=movies.json.gz` to the command line. Note that it might take up to 1 hour to index the full dataset.
90
+
Note that by default, only subset of the dataset (100 movies) is indexed. If you're interested in indexing the whole data (7918 movies), you can select the `movies.json.gz` file by adding the option `--gzip_file=movies.json.gz` to the command line. Note that it might take up to 1 hour to index the full dataset.
91
91
92
92
## Run the application
93
93
94
-
Once the data have been succesfully indexed, you can run the application to start comparing relevance models.
94
+
Once the data have been successfully indexed, you can run the application to start comparing relevance models.
95
95
96
-
The application is composed of a backend Python API and a React frontend. You can run the whole application locally using Docker compose.
96
+
The application is composed of a backend Python API and a React frontend. You can run the whole application locally using Docker compose.
97
97
98
-
Edit the `docker-compose.yml` file to replace values for. Reuse the same information that you use for loading the data.
98
+
Edit the `docker-compose.yml` file to replace values for. Reuse the same information that you use for loading the data.
99
99
- CLOUD_ID=<CLOUD_ID>
100
100
- ELASTICSEARCH_PASSWORD=<ELASTICSEARCH_PASSWORD>
101
101
102
-
Run `docker-compose up` to start the application.
102
+
Run `docker-compose up` to start the application.
103
103
104
104
Open [localhost:3000](http://localhost:3000) to access the application.
105
105
106
106
# Use your own dataset
107
107
108
-
To use your own dataset, you first need to ingest it and then configure the backend API to use it.
108
+
To use your own dataset, you first need to ingest it and then configure the backend API to use it.
109
109
110
110
## Load your own data
111
111
112
-
The first part described in the chapter below can be used similarly to load your own data.
112
+
The first part described in the chapter below can be used similarly to load your own data.
113
113
114
-
Use Enterprise Search to create a new index and configure an ML Inference pipeline. In this case, you'll need to choose yourself the fields to generate text expansion, note that ELSER inference works across text fields, and best on shorter spans of text. Those are the fields that the relevance workbench will query.
114
+
Use Enterprise Search to create a new index and configure an ML Inference pipeline. In this case, you'll need to choose yourself the fields to generate text expansion, note that ELSER inference works across text fields, and best on shorter spans of text. Those are the fields that the relevance workbench will query.
115
115
116
-
Once the index is ready, use the same Python script to ingest the data, with additional options.
116
+
Once the index is ready, use the same Python script to ingest the data, with additional options.
Copy file name to clipboardExpand all lines: notebooks/generative-ai/question-answering.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
"source": [
10
10
"# Question Answering with Langchain and OpenAI\n",
11
11
"\n",
12
-
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/colab-notebooks-examples/generative-ai/question-answering.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
12
+
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/notebooks/generative-ai/question-answering.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
13
13
"\n",
14
14
"This interactive notebook uses Langchain to split fictional workplace documents into passages and uses OpenAI to transform these passages into embeddings and store them into Elasticsearch.\n",
Copy file name to clipboardExpand all lines: notebooks/search/00-quick-start.ipynb
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
"source": [
10
10
"# Elasticsearch quick start: embeddings, semantic search, and hybrid search\n",
11
11
"\n",
12
-
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/colab-notebooks-examples/search/00-quick-start.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
12
+
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/notebooks/search/00-quick-start.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
13
13
"\n",
14
14
"This interactive notebook will introduce you to some basic operations with Elasticsearch, using the official [Elasticsearch Python client](https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/connecting.html).\n",
15
15
"You'll perform semantic search using [Sentence Transformers](https://www.sbert.net) for text embedding. Learn how to integrate traditional text-based search with semantic search, for a hybrid search system."
@@ -239,7 +239,7 @@
239
239
"source": [
240
240
"### Index test data\n",
241
241
"\n",
242
-
"Run the following command to upload some test data, containing information about 10 popular programming books from this [dataset](https://raw.githubusercontent.com/elastic/elasticsearch-labs/notebooks-guides/colab-notebooks-examples/search/data.json).\n",
242
+
"Run the following command to upload some test data, containing information about 10 popular programming books from this [dataset](https://raw.githubusercontent.com/elastic/elasticsearch-labs/blob/main/notebooks/search/data.json).\n",
243
243
"`model.encode` will encode the text into a vector on the fly, using the model we initialized earlier."
0 commit comments