From 8094c6b83b07407b0410af8ab438565e3f3827ba Mon Sep 17 00:00:00 2001 From: Saarika Bhasi <55930906+saarikabhasi@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:56:58 -0400 Subject: [PATCH] Update notebooks cloud signup url with onboarding_token (#302) * update notebooks deeplink token in signup url * update readme signup url with deeplink token * update esql notebook --- example-apps/openai-embeddings/README.md | 2 +- example-apps/relevance-workbench/README.md | 2 +- .../with-index-pipelines.ipynb | 11 +- .../with-langchain-splitters.ipynb | 11 +- .../app-search-engine-exporter.ipynb | 12 +- notebooks/esql/esql-getting-started.ipynb | 60 ++-- notebooks/generative-ai/chatbot.ipynb | 6 +- .../generative-ai/question-answering.ipynb | 2 +- notebooks/images/image-similarity.ipynb | 2 +- .../amazon-bedrock/langchain-qa-example.ipynb | 2 +- .../cohere/cohere-elasticsearch.ipynb | 13 +- .../cohere/inference-cohere.ipynb | 4 +- .../loading-model-from-hugging-face.ipynb | 2 +- .../llama3/rag-elastic-llama3-elser.ipynb | 4 +- .../llama3/rag-elastic-llama3.ipynb | 4 +- .../integrations/openai/openai-KNN-RAG.ipynb | 2 +- .../langchain/langchain-using-own-model.ipynb | 2 +- .../langchain-vector-store-using-elser.ipynb | 2 +- .../langchain/langchain-vector-store.ipynb | 2 +- .../chatbot-with-multi-query-retriever.ipynb | 2 +- .../langchain-multi-query-retriever.ipynb | 2 +- .../chatbot-example.ipynb | 2 +- .../chatbot-with-bm25-only-example.ipynb | 2 +- .../langchain-self-query-retriever.ipynb | 2 +- notebooks/search/00-quick-start.ipynb | 2 +- notebooks/search/04-multilingual.ipynb | 4 +- notebooks/search/05-query-rules.ipynb | 2 +- notebooks/search/06-synonyms-api.ipynb | 11 +- notebooks/search/07-inference.ipynb | 13 +- notebooks/search/08-learning-to-rank.ipynb | 11 +- notebooks/search/09-semantic-text.ipynb | 324 +++++++++--------- .../retrieve-and-rerank.ipynb | 60 ++-- .../ecommerce_dense_sparse_project.ipynb | 142 ++++---- .../multilingual-e5/multilingual-e5.ipynb | 4 +- .../openai_rag_streamlit.ipynb | 2 +- 35 files changed, 389 insertions(+), 341 deletions(-) diff --git a/example-apps/openai-embeddings/README.md b/example-apps/openai-embeddings/README.md index 4f7aad82..15660e19 100644 --- a/example-apps/openai-embeddings/README.md +++ b/example-apps/openai-embeddings/README.md @@ -38,7 +38,7 @@ tar -xz --strip=2 elasticsearch-labs-main/example-apps/openai-embeddings ### 3. Create Elastic Cloud account and credentials -- [Sign up](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-samples) for a Elastic cloud account +- [Sign up](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-samples) for a Elastic cloud account - Make note of the master username/password shown to you during creation of the deployment - Make note of the Elastic Cloud ID after the deployment diff --git a/example-apps/relevance-workbench/README.md b/example-apps/relevance-workbench/README.md index 0e731e41..fe1ac959 100644 --- a/example-apps/relevance-workbench/README.md +++ b/example-apps/relevance-workbench/README.md @@ -14,7 +14,7 @@ To run this demo successfully, you will need an Elasticsearch deployment (> 8.11 ## Deploy Elasticsearch in Elastic Cloud -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?utm_source=github&utm_content=elasticsearch-labs-samples). After creating an account, you’ll have an active subscription, and you’ll be prompted to create your first deployment. +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?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-samples). After creating an account, you’ll have an active subscription, and you’ll be prompted to create your first deployment. 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. diff --git a/notebooks/document-chunking/with-index-pipelines.ipynb b/notebooks/document-chunking/with-index-pipelines.ipynb index d5c6bf5b..e58c1273 100644 --- a/notebooks/document-chunking/with-index-pipelines.ipynb +++ b/notebooks/document-chunking/with-index-pipelines.ipynb @@ -25,7 +25,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "Once logged in to your Elastic Cloud account, go to the [Create deployment](https://cloud.elastic.co/deployments/create) page and select **Create deployment**. Leave all settings with their default values." ] @@ -522,7 +522,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.12.3 64-bit", "language": "python", "name": "python3" }, @@ -536,7 +536,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } } }, "nbformat": 4, diff --git a/notebooks/document-chunking/with-langchain-splitters.ipynb b/notebooks/document-chunking/with-langchain-splitters.ipynb index db5c2ad3..34870c42 100644 --- a/notebooks/document-chunking/with-langchain-splitters.ipynb +++ b/notebooks/document-chunking/with-langchain-splitters.ipynb @@ -40,7 +40,7 @@ "source": [ "### Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment." ] @@ -604,7 +604,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.12.3 64-bit", "language": "python", "name": "python3" }, @@ -618,7 +618,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } } }, "nbformat": 4, diff --git a/notebooks/enterprise-search/app-search-engine-exporter.ipynb b/notebooks/enterprise-search/app-search-engine-exporter.ipynb index bfd98c6e..9bfab3f7 100644 --- a/notebooks/enterprise-search/app-search-engine-exporter.ipynb +++ b/notebooks/enterprise-search/app-search-engine-exporter.ipynb @@ -57,7 +57,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=search&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment. \n", "\n", @@ -823,7 +823,8 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.12.3 64-bit", + "language": "python", "name": "python3" }, "language_info": { @@ -836,7 +837,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.2" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } } }, "nbformat": 4, diff --git a/notebooks/esql/esql-getting-started.ipynb b/notebooks/esql/esql-getting-started.ipynb index 60bcb39d..107dfc8d 100644 --- a/notebooks/esql/esql-getting-started.ipynb +++ b/notebooks/esql/esql-getting-started.ipynb @@ -45,7 +45,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=search&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "Once logged in to your Elastic Cloud account, go to the [Create deployment](https://cloud.elastic.co/deployments/create) page and select **Create deployment**. Leave all settings with their default values." ] @@ -75,8 +75,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Collecting elasticsearch\n", " Downloading elasticsearch-8.14.0-py3-none-any.whl (480 kB)\n", @@ -214,8 +214,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Successfully indexed 7 documents.\n" ] @@ -356,8 +356,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message \n", "--------------------------------------------------------------------------------\n", @@ -414,8 +414,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message \n", "--------------------------------------------------------------------------------\n", @@ -458,8 +458,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message \n", "--------------------------------------------------------------------------------\n", @@ -506,8 +506,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message \n", "--------------------------------------------------------------------------\n", @@ -549,8 +549,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message \n", "--------------------------------------------------------------------------------\n", @@ -609,8 +609,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message \n", "-------------------------------------------------------------------------------\n", @@ -663,8 +663,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message | duration_ms\n", "----------------------------------------------------------------------------------------------\n", @@ -709,8 +709,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message | duration_ms\n", "----------------------------------------------------------------------------------------------\n", @@ -759,8 +759,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "median_duration\n", "---------------\n", @@ -799,8 +799,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "median_duration | max_duration\n", "------------------------------\n", @@ -839,8 +839,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "median_duration | client_ip \n", "------------------------------\n", @@ -886,8 +886,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message | event_duration/1000000.0\n", "-----------------------------------------------------------------------------------------------------------\n", @@ -932,8 +932,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "MEDIAN(`event_duration/1000000.0`)\n", "----------------------------------\n", @@ -978,8 +978,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "COUNT(*) | bucket \n", "-----------------------------------\n", @@ -1019,8 +1019,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "median_duration | bucket \n", "------------------------------------------\n", @@ -1068,14 +1068,14 @@ }, "outputs": [ { - "output_type": "execute_result", "data": { "text/plain": [ "ObjectApiResponse({'status': {'phase': 'COMPLETE'}})" ] }, + "execution_count": 45, "metadata": {}, - "execution_count": 45 + "output_type": "execute_result" } ], "source": [ @@ -1143,8 +1143,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | event_duration | client_ip | env \n", "----------------------------------------------------------------------\n", @@ -1190,8 +1190,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "median_duration | env \n", "-----------------------------\n", @@ -1255,8 +1255,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "@timestamp | client_ip | event_duration | message | server_ip\n", "--------------------------------------------------------------------------------------------\n", @@ -1302,8 +1302,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "COUNT(*) | server_ip\n", "--------------------\n", @@ -1352,14 +1352,20 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.12.3 64-bit", + "language": "python", "name": "python3" }, "language_info": { "name": "python", - "version": "3.11.5" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } } }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/notebooks/generative-ai/chatbot.ipynb b/notebooks/generative-ai/chatbot.ipynb index b49e7582..45232100 100644 --- a/notebooks/generative-ai/chatbot.ipynb +++ b/notebooks/generative-ai/chatbot.ipynb @@ -27,14 +27,14 @@ "For this example, you will need:\n", "\n", "- An Elastic deployment\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", "- OpenAI account\n", "\n", "### Use Elastic Cloud\n", "\n", "If you don't have an Elastic Cloud deployment, follow these steps to create one.\n", "\n", - "1. Go to [Elastic cloud Registration](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) and sign up for a free trial\n", + "1. Go to [Elastic cloud Registration](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) and sign up for a free trial\n", "2. Select **Create Deployment** and follow the instructions\n", "\n", "### Locally install Elasticsearch\n", @@ -368,7 +368,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.3" + "version": "3.12.3" }, "orig_nbformat": 4, "vscode": { diff --git a/notebooks/generative-ai/question-answering.ipynb b/notebooks/generative-ai/question-answering.ipynb index 37e40d47..5e70c32a 100644 --- a/notebooks/generative-ai/question-answering.ipynb +++ b/notebooks/generative-ai/question-answering.ipynb @@ -61,7 +61,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/images/image-similarity.ipynb b/notebooks/images/image-similarity.ipynb index 836cec25..8ba31ce2 100644 --- a/notebooks/images/image-similarity.ipynb +++ b/notebooks/images/image-similarity.ipynb @@ -20,7 +20,7 @@ "## Prerequisities\n", "Before we begin, create an elastic cloud deployment and [autoscale](https://www.elastic.co/guide/en/cloud/current/ec-autoscaling.html) to have least one machine learning (ML) node with enough (4GB) memory. Also ensure that the Elasticsearch cluster is running. \n", "\n", - "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook)." + "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook)." ] }, { diff --git a/notebooks/integrations/amazon-bedrock/langchain-qa-example.ipynb b/notebooks/integrations/amazon-bedrock/langchain-qa-example.ipynb index 5d9f9e45..19c65ec9 100644 --- a/notebooks/integrations/amazon-bedrock/langchain-qa-example.ipynb +++ b/notebooks/integrations/amazon-bedrock/langchain-qa-example.ipynb @@ -94,7 +94,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/integrations/cohere/cohere-elasticsearch.ipynb b/notebooks/integrations/cohere/cohere-elasticsearch.ipynb index 1973ce38..35f60d1f 100644 --- a/notebooks/integrations/cohere/cohere-elasticsearch.ipynb +++ b/notebooks/integrations/cohere/cohere-elasticsearch.ipynb @@ -37,7 +37,7 @@ "For this example, you will need:\n", "\n", "- An Elastic deployment with minimum **4GB machine learning node**\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", " \n", "- A paid [Cohere account](https://cohere.com/) is required to use the Inference API with \n", "the Cohere service as the Cohere free trial API usage is limited.\n", @@ -540,9 +540,9 @@ ], "metadata": { "kernelspec": { - "display_name": "env-cohere", + "display_name": "Python 3.12.3 64-bit", "language": "python", - "name": "env-cohere" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -554,7 +554,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } } }, "nbformat": 4, diff --git a/notebooks/integrations/cohere/inference-cohere.ipynb b/notebooks/integrations/cohere/inference-cohere.ipynb index b242683b..f2514696 100644 --- a/notebooks/integrations/cohere/inference-cohere.ipynb +++ b/notebooks/integrations/cohere/inference-cohere.ipynb @@ -26,7 +26,7 @@ "For this example, you will need:\n", "\n", "- An Elastic deployment with minimum **4GB machine learning node**\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", "\n", "- Elasticsearch 8.13 or above.\n", " \n", @@ -43,7 +43,7 @@ "source": [ "# Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "- Go to the [Create deployment](https://cloud.elastic.co/deployments/create) page\n", " - Under **Advanced settings**, go to **Machine Learning instances**\n", diff --git a/notebooks/integrations/hugging-face/loading-model-from-hugging-face.ipynb b/notebooks/integrations/hugging-face/loading-model-from-hugging-face.ipynb index 1a1a2f26..cf3fa4c6 100644 --- a/notebooks/integrations/hugging-face/loading-model-from-hugging-face.ipynb +++ b/notebooks/integrations/hugging-face/loading-model-from-hugging-face.ipynb @@ -21,7 +21,7 @@ "## Prerequisities\n", "Before we begin, create an elastic cloud deployment and [autoscale](https://www.elastic.co/guide/en/cloud/current/ec-autoscaling.html) to have least one machine learning (ML) node with enough (4GB) memory. Also ensure that the Elasticsearch cluster is running. \n", "\n", - "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook).\n", + "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook).\n", "\n" ] }, diff --git a/notebooks/integrations/llama3/rag-elastic-llama3-elser.ipynb b/notebooks/integrations/llama3/rag-elastic-llama3-elser.ipynb index cbab6fd6..d4fca15b 100644 --- a/notebooks/integrations/llama3/rag-elastic-llama3-elser.ipynb +++ b/notebooks/integrations/llama3/rag-elastic-llama3-elser.ipynb @@ -22,14 +22,14 @@ "For this example, you will need:\n", "\n", "- An Elastic deployment\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", " - For LLM we will be using [Ollama](https://ollama.com/) and [Llama3](https://ollama.com/library/llama3) configured locally. \n", "\n", "### Use Elastic Cloud\n", "\n", "If you don't have an Elastic Cloud deployment, follow these steps to create one.\n", "\n", - "1. Go to [Elastic cloud Registration](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) and sign up for a free trial\n", + "1. Go to [Elastic cloud Registration](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) and sign up for a free trial\n", "2. Select **Create Deployment** and follow the instructions" ] }, diff --git a/notebooks/integrations/llama3/rag-elastic-llama3.ipynb b/notebooks/integrations/llama3/rag-elastic-llama3.ipynb index e366c36b..2ac4bda8 100644 --- a/notebooks/integrations/llama3/rag-elastic-llama3.ipynb +++ b/notebooks/integrations/llama3/rag-elastic-llama3.ipynb @@ -22,14 +22,14 @@ "For this example, you will need:\n", "\n", "- An Elastic deployment\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", " - For LLM we will be using [Ollama](https://ollama.com/) and [Llama3](https://ollama.com/library/llama3) configured locally. \n", "\n", "### Use Elastic Cloud\n", "\n", "If you don't have an Elastic Cloud deployment, follow these steps to create one.\n", "\n", - "1. Go to [Elastic cloud Registration](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) and sign up for a free trial\n", + "1. Go to [Elastic cloud Registration](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) and sign up for a free trial\n", "2. Select **Create Deployment** and follow the instructions" ] }, diff --git a/notebooks/integrations/openai/openai-KNN-RAG.ipynb b/notebooks/integrations/openai/openai-KNN-RAG.ipynb index 4df72cd7..54626fe9 100644 --- a/notebooks/integrations/openai/openai-KNN-RAG.ipynb +++ b/notebooks/integrations/openai/openai-KNN-RAG.ipynb @@ -62,7 +62,7 @@ "## Connect to Elasticsearch\n", "\n", "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook.\n", - "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=openai-cookbook).\n", + "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=openai-cookbook).\n", "\n", "To connect to Elasticsearch, you need to create a client instance with the Cloud ID and password for your deployment.\n", "\n", diff --git a/notebooks/langchain/langchain-using-own-model.ipynb b/notebooks/langchain/langchain-using-own-model.ipynb index 5f71bd4f..e16f76d9 100644 --- a/notebooks/langchain/langchain-using-own-model.ipynb +++ b/notebooks/langchain/langchain-using-own-model.ipynb @@ -45,7 +45,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "We'll use the Cloud ID to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/langchain/langchain-vector-store-using-elser.ipynb b/notebooks/langchain/langchain-vector-store-using-elser.ipynb index 56c79930..aa263d39 100644 --- a/notebooks/langchain/langchain-vector-store-using-elser.ipynb +++ b/notebooks/langchain/langchain-vector-store-using-elser.ipynb @@ -49,7 +49,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/langchain/langchain-vector-store.ipynb b/notebooks/langchain/langchain-vector-store.ipynb index e0242e8e..c9312d83 100644 --- a/notebooks/langchain/langchain-vector-store.ipynb +++ b/notebooks/langchain/langchain-vector-store.ipynb @@ -42,7 +42,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/langchain/multi-query-retriever-examples/chatbot-with-multi-query-retriever.ipynb b/notebooks/langchain/multi-query-retriever-examples/chatbot-with-multi-query-retriever.ipynb index 62a2f57f..2f6f222a 100644 --- a/notebooks/langchain/multi-query-retriever-examples/chatbot-with-multi-query-retriever.ipynb +++ b/notebooks/langchain/multi-query-retriever-examples/chatbot-with-multi-query-retriever.ipynb @@ -52,7 +52,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/langchain/multi-query-retriever-examples/langchain-multi-query-retriever.ipynb b/notebooks/langchain/multi-query-retriever-examples/langchain-multi-query-retriever.ipynb index 947e20c9..968d5aba 100644 --- a/notebooks/langchain/multi-query-retriever-examples/langchain-multi-query-retriever.ipynb +++ b/notebooks/langchain/multi-query-retriever-examples/langchain-multi-query-retriever.ipynb @@ -130,7 +130,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/langchain/self-query-retriever-examples/chatbot-example.ipynb b/notebooks/langchain/self-query-retriever-examples/chatbot-example.ipynb index 15af3533..991f74bb 100644 --- a/notebooks/langchain/self-query-retriever-examples/chatbot-example.ipynb +++ b/notebooks/langchain/self-query-retriever-examples/chatbot-example.ipynb @@ -132,7 +132,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/langchain/self-query-retriever-examples/chatbot-with-bm25-only-example.ipynb b/notebooks/langchain/self-query-retriever-examples/chatbot-with-bm25-only-example.ipynb index 17fe532c..4dc395df 100644 --- a/notebooks/langchain/self-query-retriever-examples/chatbot-with-bm25-only-example.ipynb +++ b/notebooks/langchain/self-query-retriever-examples/chatbot-with-bm25-only-example.ipynb @@ -123,7 +123,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/langchain/self-query-retriever-examples/langchain-self-query-retriever.ipynb b/notebooks/langchain/self-query-retriever-examples/langchain-self-query-retriever.ipynb index f0f60564..6bdbfc84 100644 --- a/notebooks/langchain/self-query-retriever-examples/langchain-self-query-retriever.ipynb +++ b/notebooks/langchain/self-query-retriever-examples/langchain-self-query-retriever.ipynb @@ -132,7 +132,7 @@ "source": [ "## Connect to Elasticsearch\n", "\n", - "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", + "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook. If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial. \n", "\n", "We'll use the **Cloud ID** to identify our deployment, because we are using Elastic Cloud deployment. To find the Cloud ID for your deployment, go to https://cloud.elastic.co/deployments and select your deployment.\n", "\n", diff --git a/notebooks/search/00-quick-start.ipynb b/notebooks/search/00-quick-start.ipynb index 29f1f8e5..45e50a2a 100644 --- a/notebooks/search/00-quick-start.ipynb +++ b/notebooks/search/00-quick-start.ipynb @@ -24,7 +24,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "Once logged in to your Elastic Cloud account, go to the [Create deployment](https://cloud.elastic.co/deployments/create) page and select **Create deployment**. Leave all settings with their default values." ] diff --git a/notebooks/search/04-multilingual.ipynb b/notebooks/search/04-multilingual.ipynb index ae13abd5..0842b034 100644 --- a/notebooks/search/04-multilingual.ipynb +++ b/notebooks/search/04-multilingual.ipynb @@ -37,7 +37,7 @@ "\n", "- Python 3.6 or later\n", "- An Elastic deployment with a machine learning node\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", "- The [Elastic Python client](https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/installation.html)\n" ] }, @@ -50,7 +50,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "Once logged in to your Elastic Cloud account, go to the [Create deployment](https://cloud.elastic.co/deployments/create) page and select **Create deployment**. Leave all settings with their default values." ] diff --git a/notebooks/search/05-query-rules.ipynb b/notebooks/search/05-query-rules.ipynb index 6b0d3054..84fcc8f8 100644 --- a/notebooks/search/05-query-rules.ipynb +++ b/notebooks/search/05-query-rules.ipynb @@ -24,7 +24,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=search&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "Once logged in to your Elastic Cloud account, go to the [Create deployment](https://cloud.elastic.co/deployments/create) page and select **Create deployment**. Make sure the Elasticsearch version is **8.10.0** or newer. Leave all other settings with their default values." ] diff --git a/notebooks/search/06-synonyms-api.ipynb b/notebooks/search/06-synonyms-api.ipynb index 5606d08b..7a07a6b4 100644 --- a/notebooks/search/06-synonyms-api.ipynb +++ b/notebooks/search/06-synonyms-api.ipynb @@ -21,7 +21,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=search&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "Once logged in to your Elastic Cloud account, go to the [Create deployment](https://cloud.elastic.co/deployments/create) page and select **Create deployment**. Leave all settings with their default values." ] @@ -593,7 +593,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.12.3 64-bit", "language": "python", "name": "python3" }, @@ -607,7 +607,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } } }, "nbformat": 4, diff --git a/notebooks/search/07-inference.ipynb b/notebooks/search/07-inference.ipynb index 9bac24b9..44cff210 100644 --- a/notebooks/search/07-inference.ipynb +++ b/notebooks/search/07-inference.ipynb @@ -23,7 +23,7 @@ "For this example, you will need:\n", "\n", "- An Elastic deployment:\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", "\n", "- Elasticsearch 8.12 or above.\n", " \n", @@ -38,7 +38,7 @@ "source": [ "# Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial." + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial." ] }, { @@ -409,7 +409,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.12.3 64-bit", "language": "python", "name": "python3" }, @@ -423,7 +423,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } } }, "nbformat": 4, diff --git a/notebooks/search/08-learning-to-rank.ipynb b/notebooks/search/08-learning-to-rank.ipynb index 9a9ef182..88c53419 100644 --- a/notebooks/search/08-learning-to-rank.ipynb +++ b/notebooks/search/08-learning-to-rank.ipynb @@ -65,7 +65,7 @@ "source": [ "## Configure your Elasticsearch deployment\n", "\n", - "For this example, we will be using an [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) deployment (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))." + "For this example, we will be using an [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) deployment (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))." ] }, { @@ -1197,7 +1197,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.12.3 64-bit", "language": "python", "name": "python3" }, @@ -1211,7 +1211,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.12.3" + }, + "vscode": { + "interpreter": { + "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" + } }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/notebooks/search/09-semantic-text.ipynb b/notebooks/search/09-semantic-text.ipynb index bd46271d..f531f9e2 100644 --- a/notebooks/search/09-semantic-text.ipynb +++ b/notebooks/search/09-semantic-text.ipynb @@ -2,49 +2,53 @@ "cells": [ { "cell_type": "markdown", + "id": "c2907fddfeac343a", + "metadata": { + "collapsed": false + }, "source": [ "# Semantic Search with Semantic Text\n", "\n", "\"Open\n", "\n", "Learn how to use the [semantic_text](https://www.elastic.co/guide/en/elasticsearch/reference/master/semantic-text.html) field type to quickly get started with semantic search." - ], - "metadata": { - "collapsed": false - }, - "id": "c2907fddfeac343a" + ] }, { "cell_type": "markdown", + "id": "3db37d2cf8264468", + "metadata": { + "collapsed": false + }, "source": [ "## Requirements\n", "\n", "For this example, you will need:\n", "\n", "- An Elastic deployment:\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n", + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n", "\n", "- Elasticsearch 8.15 or above, or [Elasticsearch serverless](https://www.elastic.co/elasticsearch/serverless)" - ], - "metadata": { - "collapsed": false - }, - "id": "3db37d2cf8264468" + ] }, { "cell_type": "markdown", - "source": [ - "## Create Elastic Cloud deployment\n", - "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial." - ], + "id": "7fe1ed0703a8d1d3", "metadata": { "collapsed": false }, - "id": "7fe1ed0703a8d1d3" + "source": [ + "## Create Elastic Cloud deployment\n", + "\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial." + ] }, { "cell_type": "markdown", + "id": "f9c8bd62c8241f90", + "metadata": { + "collapsed": false + }, "source": [ "## Install packages and connect with Elasticsearch Client\n", "\n", @@ -54,39 +58,39 @@ "First we need to `pip` install the following packages:\n", "\n", "- `elasticsearch`" - ], - "metadata": { - "collapsed": false - }, - "id": "f9c8bd62c8241f90" + ] }, { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "!pip install elasticsearch" - ], + "id": "13fdf7656ced2da3", "metadata": { "collapsed": false }, - "id": "13fdf7656ced2da3" + "outputs": [], + "source": [ + "!pip install elasticsearch" + ] }, { "cell_type": "markdown", + "id": "9d54b112361d2f3d", + "metadata": { + "collapsed": false + }, "source": [ "Next, we need to import the modules we need. \n", "\n", "🔐 NOTE: getpass enables us to securely prompt the user for credentials without echoing them to the terminal, or storing it in memory." - ], - "metadata": { - "collapsed": false - }, - "id": "9d54b112361d2f3d" + ] }, { "cell_type": "code", "execution_count": null, + "id": "9a60627704e77ff6", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "from elasticsearch import Elasticsearch, exceptions\n", @@ -94,28 +98,28 @@ "from getpass import getpass\n", "import json\n", "import time" - ], - "metadata": { - "collapsed": false - }, - "id": "9a60627704e77ff6" + ] }, { "cell_type": "markdown", + "id": "eb9498124146d8bb", + "metadata": { + "collapsed": false + }, "source": [ "Now we can instantiate the Python Elasticsearch client.\n", "\n", "First we prompt the user for their password and Cloud ID.\n", "Then we create a `client` object that instantiates an instance of the `Elasticsearch` class." - ], - "metadata": { - "collapsed": false - }, - "id": "eb9498124146d8bb" + ] }, { "cell_type": "code", "execution_count": null, + "id": "6e14437dcce0f235", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#finding-your-cloud-id\n", @@ -131,91 +135,91 @@ " cloud_id=ELASTIC_CLOUD_ID,\n", " api_key=ELASTIC_API_KEY,\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "6e14437dcce0f235" + ] }, { "cell_type": "markdown", + "id": "89b6b7721f6d8599", + "metadata": { + "collapsed": false + }, "source": [ "### Enable Telemetry\n", "\n", "Knowing that you are using this notebook helps us decide where to invest our efforts to improve our products. We would like to ask you that you run the following code to let us gather anonymous usage statistics. See [telemetry.py](https://github.com/elastic/elasticsearch-labs/blob/main/telemetry/telemetry.py) for details. Thank you!" - ], - "metadata": { - "collapsed": false - }, - "id": "89b6b7721f6d8599" + ] }, { "cell_type": "code", "execution_count": null, + "id": "5a7af618fb61f358", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "!curl -O -s https://raw.githubusercontent.com/elastic/elasticsearch-labs/main/telemetry/telemetry.py\n", "from telemetry import enable_telemetry\n", "\n", "client = enable_telemetry(client, \"09-semantic-text\")" - ], - "metadata": { - "collapsed": false - }, - "id": "5a7af618fb61f358" + ] }, { "cell_type": "markdown", - "source": [ - "### Test the Client\n", - "Before you continue, confirm that the client has connected with this test." - ], + "id": "cbbdaf9118a97732", "metadata": { "collapsed": false }, - "id": "cbbdaf9118a97732" + "source": [ + "### Test the Client\n", + "Before you continue, confirm that the client has connected with this test." + ] }, { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "print(client.info())" - ], + "id": "4cb0685fae12e034", "metadata": { "collapsed": false }, - "id": "4cb0685fae12e034" + "outputs": [], + "source": [ + "print(client.info())" + ] }, { "cell_type": "markdown", + "id": "59e2223bf2c4331", + "metadata": { + "collapsed": false + }, "source": [ "Refer to [the documentation](https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/connecting.html#connect-self-managed-new) to learn how to connect to a self-managed deployment.\n", "\n", "Read [this page](https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/connecting.html#connect-self-managed-new) to learn how to connect using API keys." - ], - "metadata": { - "collapsed": false - }, - "id": "59e2223bf2c4331" + ] }, { "cell_type": "markdown", + "id": "22fa643780acd44a", + "metadata": { + "collapsed": false + }, "source": [ "## Create the Inference Endpoint\n", "\n", "Let's create the inference endpoint by using the [Create inference API](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html).\n", "\n", "For this example we'll use the [ELSER service](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html), but the inference API also supports [many other inference services](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html#put-inference-api-desc)." - ], - "metadata": { - "collapsed": false - }, - "id": "22fa643780acd44a" + ] }, { "cell_type": "code", "execution_count": null, + "id": "8ee2188ea71324f5", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "try:\n", @@ -241,26 +245,26 @@ " print(\"Inference endpoint created successfully\")\n", " else:\n", " raise e" - ], - "metadata": { - "collapsed": false - }, - "id": "8ee2188ea71324f5" + ] }, { "cell_type": "markdown", - "source": [ - "Once the endpoint is created, we must wait until the backing ELSER service is deployed.\n", - "This can take a few minutes to complete." - ], + "id": "e94fd66761fd8087", "metadata": { "collapsed": false }, - "id": "e94fd66761fd8087" + "source": [ + "Once the endpoint is created, we must wait until the backing ELSER service is deployed.\n", + "This can take a few minutes to complete." + ] }, { "cell_type": "code", "execution_count": null, + "id": "adb33329ce20b2f1", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "inference_endpoint_info = client.inference.get_model(\n", @@ -286,27 +290,27 @@ " else:\n", " print(\"ELSER Model is currently being deployed.\")\n", " time.sleep(5)" - ], - "metadata": { - "collapsed": false - }, - "id": "adb33329ce20b2f1" + ] }, { "cell_type": "markdown", + "id": "818f7a72a83b5776", + "metadata": { + "collapsed": false + }, "source": [ "## Create the Index\n", "\n", "Now we need to create an index with a `semantic_text` field. Let's create one that enables us to perform semantic search on movie plots." - ], - "metadata": { - "collapsed": false - }, - "id": "818f7a72a83b5776" + ] }, { "cell_type": "code", "execution_count": null, + "id": "ace87760606f67c6", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "client.indices.delete(index=\"semantic-text-movies\", ignore_unavailable=True)\n", @@ -324,39 +328,39 @@ " }\n", " },\n", ")" - ], - "metadata": { - "collapsed": false - }, - "id": "ace87760606f67c6" + ] }, { "cell_type": "markdown", + "id": "abc3ee7a1fddfa9b", + "metadata": { + "collapsed": false + }, "source": [ "Notice how we configured the mappings. We defined `plot_semantic` as a `semantic_text` field.\n", "The `inference_id` parameter defines the inference endpoint that is used to generate the embeddings for the field.\n", "Then we configured the `plot` field to [copy its value](https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html) to the `plot_semantic` field." - ], - "metadata": { - "collapsed": false - }, - "id": "abc3ee7a1fddfa9b" + ] }, { "cell_type": "markdown", + "id": "2b5a46b60660a489", + "metadata": { + "collapsed": false + }, "source": [ "## Populate the Index\n", "\n", "Let's populate the index with our example dataset of 12 movies." - ], - "metadata": { - "collapsed": false - }, - "id": "2b5a46b60660a489" + ] }, { "cell_type": "code", "execution_count": null, + "id": "24f0133923553d28", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "url = \"https://raw.githubusercontent.com/elastic/elasticsearch-labs/main/notebooks/search/movies.json\"\n", @@ -368,14 +372,14 @@ " operations.append({\"index\": {\"_index\": \"semantic-text-movies\"}})\n", " operations.append(movie)\n", "client.bulk(index=\"semantic-text-movies\", operations=operations, refresh=True)" - ], - "metadata": { - "collapsed": false - }, - "id": "24f0133923553d28" + ] }, { "cell_type": "markdown", + "id": "6fff5932fcbac1b0", + "metadata": { + "collapsed": false + }, "source": [ "## Semantic Search\n", "\n", @@ -385,15 +389,15 @@ "\n", "Your `search` API calls will return hard-to-read nested JSON.\n", "We'll create a little function called `pretty_search_response` to return nice, human-readable outputs from our examples." - ], - "metadata": { - "collapsed": false - }, - "id": "6fff5932fcbac1b0" + ] }, { "cell_type": "code", "execution_count": null, + "id": "ad417b4b3f50c889", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "def pretty_search_response(response):\n", @@ -413,28 +417,28 @@ " pretty_output = f\"\\nID: {id}\\nScore: {score}\\nTitle: {title}\\nRuntime: {runtime}\\nPlot: {plot}\\nKey Scene: {keyScene}\\nGenre: {genre}\\nReleased: {released}\"\n", "\n", " print(pretty_output)" - ], - "metadata": { - "collapsed": false - }, - "id": "ad417b4b3f50c889" + ] }, { "cell_type": "markdown", + "id": "22c4d4d395adb472", + "metadata": { + "collapsed": false + }, "source": [ "### Semantic Search with the `semantic` Query\n", "\n", "We can use the [`semantic` query](https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-semantic-query.html) to quickly & easily query the `semantic_text` field in our index.\n", "Under the hood, an embedding is automatically generated for our query text using the `semantic_text` field's inference endpoint." - ], - "metadata": { - "collapsed": false - }, - "id": "22c4d4d395adb472" + ] }, { "cell_type": "code", "execution_count": null, + "id": "1a8520ffc8a3efb3", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "response = client.search(\n", @@ -443,14 +447,14 @@ ")\n", "\n", "pretty_search_response(response)" - ], - "metadata": { - "collapsed": false - }, - "id": "1a8520ffc8a3efb3" + ] }, { "cell_type": "markdown", + "id": "148fda24a3964aa9", + "metadata": { + "collapsed": false + }, "source": [ "These results demonstrate the power of semantic search.\n", "Our top results are all movies involving organized crime, even if the exact term \"organized crime\" doesn't appear in the plot description.\n", @@ -459,28 +463,28 @@ "However, these results also show the weaknesses of semantic search.\n", "Because semantic search is based on vector similarity, there is a long tail of results that are weakly related to our query vector.\n", "That's why movies like _The Matrix_ are returned towards the tail end of our search results." - ], - "metadata": { - "collapsed": false - }, - "id": "148fda24a3964aa9" + ] }, { "cell_type": "markdown", + "id": "7c9bab225a745746", + "metadata": { + "collapsed": false + }, "source": [ "### Hybrid Search with the `semantic` Query\n", "\n", "We can address some of the issues with pure semantic search by combining it with lexical search techniques.\n", "Here, we use a [boolean query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html) to require that all matches contain at least term from the query text, in either the `plot` or `genre` fields." - ], - "metadata": { - "collapsed": false - }, - "id": "7c9bab225a745746" + ] }, { "cell_type": "code", "execution_count": null, + "id": "4f72f7906b918dc1", + "metadata": { + "collapsed": false + }, "outputs": [], "source": [ "response = client.search(\n", @@ -506,14 +510,14 @@ ")\n", "\n", "pretty_search_response(response)" - ], - "metadata": { - "collapsed": false - }, - "id": "4f72f7906b918dc1" + ] }, { "cell_type": "markdown", + "id": "d50d10ced4389107", + "metadata": { + "collapsed": false + }, "source": [ "These results demonstrate that the application of lexical search techniques can help focus the results, while retaining many of the advantages of semantic search.\n", "In this example, the top search results are all still movies involving organized crime, but the `multi_match` query keeps the long tail shorter and focused on movies in the crime genre.\n", @@ -526,24 +530,20 @@ "- The relative importance and accuracy of the query in the context of the dataset\n", "\n", "In this example, the `multi_match` query is mostly used as a filter to constrain the search results' long tail, so we assign it a lower boost than the `semantic` query." - ], - "metadata": { - "collapsed": false - }, - "id": "d50d10ced4389107" + ] }, { "cell_type": "markdown", + "id": "78be304240d6c695", + "metadata": { + "collapsed": false + }, "source": [ "## Conclusion\n", "\n", "The [semantic_text](https://www.elastic.co/guide/en/elasticsearch/reference/master/semantic-text.html) field type is a powerful tool that can help you quickly and easily integrate semantic search.\n", "It can greatly improve the relevancy of your search results, particularly when combined with lexical search techniques." - ], - "metadata": { - "collapsed": false - }, - "id": "78be304240d6c695" + ] } ], "metadata": { diff --git a/supporting-blog-content/evaluating-search-relevance-part-1/retrieve-and-rerank.ipynb b/supporting-blog-content/evaluating-search-relevance-part-1/retrieve-and-rerank.ipynb index a84cf2d6..cc6d0ef1 100644 --- a/supporting-blog-content/evaluating-search-relevance-part-1/retrieve-and-rerank.ipynb +++ b/supporting-blog-content/evaluating-search-relevance-part-1/retrieve-and-rerank.ipynb @@ -42,7 +42,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "Once logged in to your Elastic Cloud account, go to the [Create deployment](https://cloud.elastic.co/deployments/create) page and select **Create deployment**. Leave all settings with their default values.\n", "\n", "\n", @@ -775,20 +775,25 @@ ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "---", - "id": "1eae7142374e2f7a" + "id": "1eae7142374e2f7a", + "metadata": {}, + "source": [ + "---" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "### Confidence intervals", - "id": "392ab084d5bc024" + "id": "392ab084d5bc024", + "metadata": {}, + "source": [ + "### Confidence intervals" + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "6fb391b00a7efd58", + "metadata": {}, "source": [ "In this section we will briefly touch upon the concepts of `confidence intervals` and `statistical significance` and we will see how we can use them to determine whether improvements in our pipelines are significant or not.\n", "\n", @@ -798,14 +803,14 @@ "\n", "The code below shows an example of deriving confidence intervals using [bootstrapping](https://en.wikipedia.org/wiki/Bootstrapping_\\(statistics\\)) combined with the `percentile` method. It should be noted that this statistic is affected a lot by the number and the variability of queries in the dataset i.e. smaller confidence intervals are expected for larger query sets and vice versa\n", " " - ], - "id": "6fb391b00a7efd58" + ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "3b5563e681b4236", + "metadata": {}, + "outputs": [], "source": [ "def get_ci_with_bootstrapping(scores: list, nr_bootstraps=1000, percentile=95):\n", " \"\"\"\n", @@ -825,29 +830,31 @@ "\n", " half_percentile = (100.0 - percentile) / 2.0\n", " return np.percentile(estimates, [half_percentile, 100.0 - half_percentile])" - ], - "id": "3b5563e681b4236" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "and we can apply it to our results as follows:", - "id": "701ed82491660fd6" + "id": "701ed82491660fd6", + "metadata": {}, + "source": [ + "and we can apply it to our results as follows:" + ] }, { - "metadata": {}, "cell_type": "code", - "outputs": [], "execution_count": null, + "id": "9f2f080185190b58", + "metadata": {}, + "outputs": [], "source": [ "ndcg_scores = post_reranking_eval_scores[\"ndcg_cut_10\"]\n", "get_ci_with_bootstrapping(ndcg_scores, percentile=95, nr_bootstraps=1000)" - ], - "id": "9f2f080185190b58" + ] }, { - "metadata": {}, "cell_type": "markdown", + "id": "be4d62dfde0c588b", + "metadata": {}, "source": [ "The way to interpret this would be to say that we are 95% confident that the `nDCG@10` score in the ideal scenario lies within that interval\n", "\n", @@ -858,14 +865,13 @@ "* Check whether there is an overlap between the two intervals. \n", "\n", "In the last step, if there is **no** overlap we can say that the observed difference in performance between the two pipelines is **statistically significant**. " - ], - "id": "be4d62dfde0c588b" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "", - "id": "4f8bf706821ab252" + "id": "4f8bf706821ab252", + "metadata": {}, + "source": [] } ], "metadata": { diff --git a/supporting-blog-content/lexical-and-semantic-search-with-elasticsearch/ecommerce_dense_sparse_project.ipynb b/supporting-blog-content/lexical-and-semantic-search-with-elasticsearch/ecommerce_dense_sparse_project.ipynb index 3d515f3f..42386dae 100644 --- a/supporting-blog-content/lexical-and-semantic-search-with-elasticsearch/ecommerce_dense_sparse_project.ipynb +++ b/supporting-blog-content/lexical-and-semantic-search-with-elasticsearch/ecommerce_dense_sparse_project.ipynb @@ -2,6 +2,10 @@ "cells": [ { "cell_type": "markdown", + "id": "r8OKk3QOGBXl", + "metadata": { + "id": "r8OKk3QOGBXl" + }, "source": [ "# **Lexical and Semantic Search with Elasticsearch**\n", "\n", @@ -20,26 +24,22 @@ "- Elastic 8.8 deployment or later, with 8GB memory machine learning node\n", "- The Elastic Learned Sparse EncodeR model that comes pre-loaded into Elastic installed and started on your deployment\n", "\n", - "We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html), a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) is available." - ], - "metadata": { - "id": "r8OKk3QOGBXl" - }, - "id": "r8OKk3QOGBXl" + "We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html), a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) is available." + ] }, { "cell_type": "markdown", + "id": "hmMWo2e-IkTB", + "metadata": { + "id": "hmMWo2e-IkTB" + }, "source": [ "## Setup Elasticsearch environment:\n", "\n", "To get started, we'll need to connect to our Elastic deployment using the Python client.\n", "\n", "Because we're using an Elastic Cloud deployment, we'll use the **Cloud ID** to identify our deployment.\n" - ], - "metadata": { - "id": "hmMWo2e-IkTB" - }, - "id": "hmMWo2e-IkTB" + ] }, { "cell_type": "code", @@ -91,6 +91,10 @@ }, { "cell_type": "markdown", + "id": "ea1VkDBXJIQR", + "metadata": { + "id": "ea1VkDBXJIQR" + }, "source": [ "Now we can instantiate the Python Elasticsearch client.\n", "\n", @@ -99,11 +103,7 @@ "🔐 NOTE: `getpass` enables us to securely prompt the user for credentials without echoing them to the terminal, or storing it in memory.\n", "\n", "Then we create a `client` object that instantiates an instance of the `Elasticsearch` class." - ], - "metadata": { - "id": "ea1VkDBXJIQR" - }, - "id": "ea1VkDBXJIQR" + ] }, { "cell_type": "code", @@ -128,15 +128,15 @@ }, { "cell_type": "markdown", + "id": "BH-N6epTJarM", + "metadata": { + "id": "BH-N6epTJarM" + }, "source": [ "## Setup emebdding model\n", "\n", "Next we upload the all-mpnet-base-v2 embedding model into Elasticsearch and create an ingest pipeline with inference processors for text embedding and text expansion, using the description field for both. This field contains the description of each product." - ], - "metadata": { - "id": "BH-N6epTJarM" - }, - "id": "BH-N6epTJarM" + ] }, { "cell_type": "code", @@ -212,17 +212,17 @@ }, { "cell_type": "markdown", + "id": "QUQ1nCaiKIQr", + "metadata": { + "id": "QUQ1nCaiKIQr" + }, "source": [ "## Index documents\n", "\n", "Then, we create a source index to load `products-ecommerce.json`, this will be the `ecommerce` index and a destination index to extract the documents from the source and index these documents into the destination `ecommerce-search`.\n", "\n", "For the `ecommerce-search` index we add a field to support dense vector storage and search `description_vector.predicted_value`, this is the target field for inference results. The field type in this case is `dense_vector`, the `all-mpnet-base-v2` model has embedding_size of 768, so dims is set to 768. We also add a `rank_features` field type to support the text expansion output." - ], - "metadata": { - "id": "QUQ1nCaiKIQr" - }, - "id": "QUQ1nCaiKIQr" + ] }, { "cell_type": "code", @@ -304,15 +304,15 @@ }, { "cell_type": "markdown", + "id": "Vo-LKu8TOT5j", + "metadata": { + "id": "Vo-LKu8TOT5j" + }, "source": [ "## Load documents\n", "\n", "Then we load `products-ecommerce.json` into the `ecommerce` index." - ], - "metadata": { - "id": "Vo-LKu8TOT5j" - }, - "id": "Vo-LKu8TOT5j" + ] }, { "cell_type": "code", @@ -352,17 +352,17 @@ }, { "cell_type": "markdown", + "id": "3dShN9W4Opl8", + "metadata": { + "id": "3dShN9W4Opl8" + }, "source": [ "## Reindex\n", "\n", "Now we can reindex data from the `source` index `ecommerce` to the `dest` index `ecommerce-search` with the ingest pipeline `ecommerce-pipeline` we created.\n", "\n", "After this step our `dest` index will have the fields we need to perform Semantic Search." - ], - "metadata": { - "id": "3dShN9W4Opl8" - }, - "id": "3dShN9W4Opl8" + ] }, { "cell_type": "code", @@ -384,13 +384,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Text Analysis with Standard Analyzer" - ], + "id": "-qUXNuOvPDsI", "metadata": { "id": "-qUXNuOvPDsI" }, - "id": "-qUXNuOvPDsI" + "source": [ + "## Text Analysis with Standard Analyzer" + ] }, { "cell_type": "code", @@ -421,13 +421,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Text Analysis with Stop Analyzer" - ], + "id": "12u70NLmPyNV", "metadata": { "id": "12u70NLmPyNV" }, - "id": "12u70NLmPyNV" + "source": [ + "## Text Analysis with Stop Analyzer" + ] }, { "cell_type": "code", @@ -458,13 +458,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Lexical Search" - ], + "id": "8G8MKcUvP0zs", "metadata": { "id": "8G8MKcUvP0zs" }, - "id": "8G8MKcUvP0zs" + "source": [ + "## Lexical Search" + ] }, { "cell_type": "code", @@ -506,13 +506,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Semantic Search with Dense Vector" - ], + "id": "xiywcf_-P39a", "metadata": { "id": "xiywcf_-P39a" }, - "id": "xiywcf_-P39a" + "source": [ + "## Semantic Search with Dense Vector" + ] }, { "cell_type": "code", @@ -554,13 +554,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Semantic Search with Sparse Vector" - ], + "id": "QlWFdngRQFbv", "metadata": { "id": "QlWFdngRQFbv" }, - "id": "QlWFdngRQFbv" + "source": [ + "## Semantic Search with Sparse Vector" + ] }, { "cell_type": "code", @@ -599,13 +599,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Hybrid Search - BM25+KNN linear combination" - ], + "id": "kz9deDBYQJxr", "metadata": { "id": "kz9deDBYQJxr" }, - "id": "kz9deDBYQJxr" + "source": [ + "## Hybrid Search - BM25+KNN linear combination" + ] }, { "cell_type": "code", @@ -662,13 +662,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Hybrid Search - BM25+KNN RRF" - ], + "id": "cybkWjmpQV8g", "metadata": { "id": "cybkWjmpQV8g" }, - "id": "cybkWjmpQV8g" + "source": [ + "## Hybrid Search - BM25+KNN RRF" + ] }, { "cell_type": "code", @@ -730,13 +730,13 @@ }, { "cell_type": "markdown", - "source": [ - "## Hybrid Search - BM25+ELSER linear combination" - ], + "id": "LyKI2Z-XQbI6", "metadata": { "id": "LyKI2Z-XQbI6" }, - "id": "LyKI2Z-XQbI6" + "source": [ + "## Hybrid Search - BM25+ELSER linear combination" + ] }, { "cell_type": "code", @@ -790,6 +790,9 @@ } ], "metadata": { + "colab": { + "provenance": [] + }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", @@ -806,9 +809,6 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.10" - }, - "colab": { - "provenance": [] } }, "nbformat": 4, diff --git a/supporting-blog-content/multilingual-e5/multilingual-e5.ipynb b/supporting-blog-content/multilingual-e5/multilingual-e5.ipynb index 21187d95..29e3a8ad 100644 --- a/supporting-blog-content/multilingual-e5/multilingual-e5.ipynb +++ b/supporting-blog-content/multilingual-e5/multilingual-e5.ipynb @@ -26,7 +26,7 @@ "For this example, you will need:\n", "\n", "- An Elastic Cloud deployment with an ML node (min. 8 GB memory)\n", - " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook))\n" + " - We'll be using [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) for this example (available with a [free trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook))\n" ] }, { @@ -37,7 +37,7 @@ "source": [ "## Create Elastic Cloud deployment\n", "\n", - "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", + "If you don't have an Elastic Cloud deployment, sign up [here](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook) for a free trial.\n", "\n", "- Go to the [Create deployment](https://cloud.elastic.co/deployments/create) page\n", " - Select **Create deployment**\n", diff --git a/supporting-blog-content/openai-rag-streamlit/openai_rag_streamlit.ipynb b/supporting-blog-content/openai-rag-streamlit/openai_rag_streamlit.ipynb index 8ad9c31d..01584171 100644 --- a/supporting-blog-content/openai-rag-streamlit/openai_rag_streamlit.ipynb +++ b/supporting-blog-content/openai-rag-streamlit/openai_rag_streamlit.ipynb @@ -78,7 +78,7 @@ "## Connect to Elasticsearch\n", "\n", "ℹ️ We're using an Elastic Cloud deployment of Elasticsearch for this notebook.\n", - "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?utm_source=github&utm_content=elasticsearch-labs-notebook).\n", + "If you don't already have an Elastic deployment, you can sign up for a free [Elastic Cloud trial](https://cloud.elastic.co/registration?onboarding_token=vectorsearch&utm_source=github&utm_content=elasticsearch-labs-notebook).\n", "\n", "To connect to Elasticsearch, you need to create a client instance with the Cloud ID and password for your deployment.\n", "\n",