/chat-pdf

A RAG project. Chat PDF

Primary LanguagePythonMIT LicenseMIT

title emoji colorFrom colorTo sdk sdk_version app_file pinned
Chat PDF
📋
purple
green
streamlit
1.35.0
app.py
false

Chat PDF

This is a RAG(Retrieval Augmented Generation) project that allows users to upload PDF files, extract text from them, and then ask questions about the content of the PDFs. The application uses the Gemini model from Google Generative AI to generate responses to user questions. Check this out here: https://salahin-chat-pdf.hf.space/

Features

  • Upload multiple PDF files
  • Extract text from PDF files
  • Split text into chunks for efficient processing
  • Create a vector store from text chunks using FAISS
  • Use a conversational chain to generate responses to user questions
  • Display conversation history

How to Use

  1. Upload one or more PDF files using the file uploader in the sidebar.
  2. Click the "Submit" button to process the PDF files.
  3. Ask a question about the content of the PDF files using the chat input box.
  4. The application will generate a response to your question and display it in the chat window.

Technical Details

The application uses the following libraries:

  • streamlit for the web interface
  • PyPDF2 for extracting text from PDF files
  • Langchain for creating a conversational chain
  • Google Generative AI for generating responses to user questions
  • FAISS for creating a vector store from text chunks

The application uses a recursive character text splitter to split text into chunks of 10,000 characters with an overlap of 1,000 characters. The conversational chain uses a prompt template to generate responses to user questions.

Local Run

To run the application locally, follow these steps:

  1. Clone the repository using git clone.
https://github.com/MahirSalahin/Chat-PDF.git
  1. Install the required libraries using
pip install -r requirements.txt.
  1. Set your GOOGLE_API_KEY in the .env file.
  2. Run the application using
streamlit run app.py

License

This project is licensed under the MIT License.