Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Marci Windsheimer <[email protected]>
  • Loading branch information
szabosteve and marciw authored May 13, 2024
1 parent 35cb4cf commit 55cfb4b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions notebooks/integrations/cohere/cohere-elasticsearch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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."
]
},
{
Expand Down Expand Up @@ -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",
Expand All @@ -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`."
]
},
Expand Down Expand Up @@ -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."
]
},
Expand Down Expand Up @@ -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."
]
},
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 55cfb4b

Please sign in to comment.