RAG with Azure AI Search

Nov 15 2024 · Python 3.12, Microsoft Azure, JupyterLab

Lesson 03: Hybrid Search with Azure AI Search

Demo

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

You’ve read a lot about how Azure AI Search performs hybrid searches — now it’s time to see it in action! In this demo, you’ll build an app that uses Azure AI Search to perform a hybrid search on its data.

Client Creation

The next cell creates an AzureOpenAI client based on a bearer token obtained from the Default Azure Credential. This client is then used to generate embeddings for the titles and content within the television show information text file. Finally, it saves these embeddings to a file. Run this cell to generate the embeddings.

Search Index Clent

In the next cell, you create a SearchIndexClient and set the field types. Title is a searchable field data type, as are content and category. Next are the title and content vectors. This is your access point to Azure AI Search when you need to perform a search. Run this cell to create the search index client.

Semantic Search

In the cell below “Configure the Semantic Search,” create a semantic configuration object from the selected fields in your data source. Then, use it to create an instance of a semantic search. Run this cell to complete the task.

See forum comments
Cinema mode Download course materials from Github
Previous: Instruction 02 Next: Instruction 03