Chat with PDF is a Streamlit application that allows users to upload PDF files, process the text within them, and ask questions about the content. The app uses LangChain, Google Generative AI, and FAISS for embedding, vectorizing, and answering questions based on the uploaded PDFs.
- Upload multiple PDF files
- Extract text from PDF files
- Split text into manageable chunks
- Generate embeddings using Google Generative AI
- Vectorize text chunks using FAISS
- Answer user questions based on the content of the PDFs
- Python 3.8 or later
- Streamlit
- PyPDF2
- LangChain
- FAISS
- LangChain Google Generative AI
- Google Generative AI SDK
- python-dotenv
-
Clone the repository:
git clone https://github.com/yourusername/chat-with-pdf.git cd chat-with-pdf
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory and add your Google API key:GOOGLE_API_KEY=your_google_api_key
-
Run the Streamlit application:
streamlit run app.py
-
Open your browser and go to
http://localhost:8501
. -
Upload your PDF files using the sidebar and click "Submit & Process".
-
Ask a question in the input field and get answers based on the content of the uploaded PDFs.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any bugs, features, or documentation improvements.
For any questions or suggestions, please open an issue on the GitHub repository or contact the author.