From 55cfb4b75b8e3bfc1b3905be9adac4da73fb14ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 13 May 2024 10:26:46 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Marci Windsheimer <333176+marciw@users.noreply.github.com> --- .../cohere/cohere-elasticsearch.ipynb | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/notebooks/integrations/cohere/cohere-elasticsearch.ipynb b/notebooks/integrations/cohere/cohere-elasticsearch.ipynb index 8524561e..ec06df3d 100644 --- a/notebooks/integrations/cohere/cohere-elasticsearch.ipynb +++ b/notebooks/integrations/cohere/cohere-elasticsearch.ipynb @@ -9,9 +9,9 @@ "\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/elastic/elasticsearch-labs/blob/main/notebooks/integrations/cohere/cohere-elasticsearch.ipynb)\n", "\n", - "The instructions in this tutorial shows you how to compute embeddings with\n", + "This tutorial shows you how to compute embeddings with\n", "Cohere using the inference API and store them for efficient vector or hybrid\n", - "search in Elasticsearch. This tutorial will use the Python Elasticsearch client\n", + "search in Elasticsearch. This tutorial uses the Python Elasticsearch client\n", "to perform the operations.\n", "\n", "You'll learn how to:\n", @@ -42,7 +42,7 @@ "- 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", "\n", - "- Python 3.7 or higher." + "- Python 3.7 or later." ] }, { @@ -118,7 +118,7 @@ "ELASTIC_CLOUD_ID = getpass(\"Elastic Cloud ID: \")\n", "\n", "# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#creating-an-api-key\n", - "ELASTIC_API_KEY = getpass(\"Elastic Api key: \")\n", + "ELASTIC_API_KEY = getpass(\"Elastic API key: \")\n", "\n", "# Create the client instance\n", "client = Elasticsearch(\n", @@ -139,8 +139,8 @@ "source": [ "## Create the inference endpoint\n", "\n", - "Create the inference endpoint first. In this example, the inference endpoint will \n", - "use Cohere's `embed-english-v3.0` model and the `embedding_type` is set to\n", + "Create the inference endpoint first. In this example, the inference endpoint \n", + "uses Cohere's `embed-english-v3.0` model and the `embedding_type` is set to\n", "`byte`." ] }, @@ -228,7 +228,7 @@ "## Create the inference pipeline\n", "\n", "Now you have an inference endpoint and an index ready to store embeddings. The next\n", - "step is to create an ingest pipeline that will create the embeddings using the\n", + "step is to create an ingest pipeline that creates the embeddings using the\n", "inference endpoint and stores them in the index." ] }, @@ -324,8 +324,8 @@ "Let's start querying the index!\n", "\n", "The code below performs a hybrid search. The `kNN` query computes the relevance\n", - "of search results based on vector similarity using the `text_embedding` field,\n", - "the lexical search query uses BM25 retrieval to compute keyword similarity on\n", + "of search results based on vector similarity using the `text_embedding` field.\n", + "The lexical search query uses BM25 retrieval to compute keyword similarity on\n", "the `title` and `text` fields." ] }, @@ -491,8 +491,8 @@ "## Retrieval Augmented Generation (RAG) with Cohere and Elasticsearch\n", "\n", "RAG is a method for generating text using additional information fetched from an\n", - "external data source. With the ranked results, you can build a RAG system on the\n", - "top of what you previously created by using \n", + "external data source. With the ranked results, you can build a RAG system on\n", + "top of what you created with \n", "[Cohere's Chat API](https://docs.cohere.com/docs/chat-api).\n", "\n", "Pass in the retrieved documents and the query to receive a grounded response\n",