Skip main navigation

Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. T&Cs apply

Hybrid Search Homework Exercise

Building Hybrid Search Application on long legal documents.

Homework Instructions:

In this exercise, you will implement a Hybrid Search ARG system to find relevant cases from large legal documents. You will practice:

  • loading a large legal documents,
  • creating a sparse encoder based on SPLADE and a dense encoder using OpenAI embedding,
  • uploading the two sets of vectors for the documents’ chunks into a vector database,
  • searching the sparse and dense indexes,
  • reranking the combined set of chunks using the Cohere reranking model and
  • generating a reply using GPT-4 based on the retrieved document chunk.

The exercise includes a notebook with some of the code missing. Complete the code based on the instructions in the notebook, and answer the questions below with the output cells’ data after the code completion.

The notebook (“exercise/03_hybrid_search_exercise.ipynb”) is under the folder in the GitHub repository and here.

This article is from the free online

Advanced Retrieval-Augmented Generation (RAG) for Large Language Models

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now