Skip to content

A simple streamlit app that performs Retrieval-Augmented Generation over a corpus of presidential speeches

Notifications You must be signed in to change notification settings

definitive-io/presidential-speeches-rag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Presidential Speeches RAG

This repository contains a Streamlit application that allows users to ask questions about US presidents. The application uses a pre-trained model to find relevant excerpts from presidential speeches and generate responses to the user's questions.

Features

  • Question-Answering System: Users can ask questions about US presidents, and the application will generate responses based on relevant excerpts from presidential speeches.

  • Customization: Users can provide additional context for the model and choose from a list of pre-trained models.

  • Similarity Search: The application uses a Pinecone vector store to find the most relevant excerpts from presidential speeches based on the user's question.

Code Overview

The main script of the application is app.py. Here's a brief overview of its main functions:

  • get_relevant_excerpts(user_question, docsearch): This function takes a user's question and a Pinecone vector store as input, performs a similarity search on the vector store using the user's question, and returns the most relevant excerpts from presidential speeches.

  • get_relevant_excerpts(user_question, docsearch): This function takes a user's question and a Pinecone vector store as input, performs a similarity search on the vector store using the user's question, and returns the most relevant excerpts from presidential speeches.

  • presidential_speech_chat_completion(client, model, user_question, relevant_excerpts, additional_context): This function takes a Groq client, a pre-trained model, a user's question, relevant excerpts from presidential speeches, and additional context as input. It generates a response to the user's question based on the relevant excerpts and the additional context

About

A simple streamlit app that performs Retrieval-Augmented Generation over a corpus of presidential speeches

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages