The PDF Chat App with Gemini is a Streamlit-based web application that allows users to interact with and query multiple PDF documents. By integrating Google Generative AI (Gemini) and FAISS (Facebook AI Similarity Search), this application provides advanced text analysis and question-answering capabilities. Users can upload PDF files, process their content, and ask questions related to the information within those documents.
- PDF Upload: Support for uploading multiple PDF files.
- Text Extraction: Extract text from the uploaded PDFs.
- Text Chunking: Split large texts into manageable chunks.
- Vector Store: Store and manage text embeddings using FAISS.
- Question Answering: Utilize Gemini AI to answer questions based on PDF content.
- User Interface: A simple and intuitive web interface built with Streamlit.
- Python 3.7 or higher
- Virtual Environment (Recommended)
-
Clone the Repository:
Open your terminal and clone the repository using the following command:
git clone https://github.com/yourusername/your-repo-name.git
Navigate into the project directory:
cd your-repo-name -
Create a Virtual Environment:
Create a virtual environment to manage your project dependencies:
python -m venv env
Activate the virtual environment:
-
On Windows:
env\Scripts\activate
-
On macOS/Linux:
source env/bin/activate
-
-
Install Dependencies:
Install the required Python libraries using pip:
pip install -r requirements.txt
-
Set Up Environment Variables:
Create a
.envfile in the root directory of the project. Add your Google API key in the following format:GOOGLE_API_KEY=your_google_api_key_here -
Run the Application:
Start the Streamlit application by running:
streamlit run app.py
Open your web browser and navigate to
http://localhost:8501to access the application.
-
Upload PDF Files:
- On the sidebar, use the file uploader widget to select and upload your PDF files.
- Click the "Submit & process" button to extract text from the uploaded PDFs and create text embeddings.
-
Ask Questions:
- Enter your questions in the text input field on the main page.
- Click the "Submit" button to receive answers based on the content of the PDFs.
app.py: The main application script where the Streamlit app logic is defined.requirements.txt: Lists the Python dependencies required for the project..env: Contains environment variables, such as API keys.README.md: Documentation file for the project.
We welcome contributions to the project. To contribute:
-
Fork the Repository:
Click the "Fork" button on the repository page to create a personal copy of the project.
-
Create a New Branch:
git checkout -b feature/YourFeature
-
Make Changes:
Implement your changes and commit them:
git commit -am 'Add new feature' -
Push to GitHub:
git push origin feature/YourFeature
-
Create a Pull Request:
Go to the repository on GitHub and click "New Pull Request" to propose your changes.
Thank you for using the PDF Chat App with Gemini!