This project is a PDF Summarizer that uses Google's Gemini AI API to generate summaries of uploaded PDF documents. The application is built using Streamlit for an interactive UI and PyPDF2 for extracting text from PDF files.
- Upload and summarize PDF documents.
- Uses Gemini AI to generate concise and meaningful summaries.
- Interactive UI using Streamlit.
- Displays extracted summaries instantly.
- Error handling for file processing and API interactions.
git clone https://github.com/your-username/pdf-summarizer.git
cd pdf-summarizer
It is recommended to create a virtual environment to manage dependencies.
# For Windows
python -m venv venv
venv\Scripts\activate
# For macOS/Linux
python3 -m venv venv
source venv/bin/activate
Install the required dependencies using pip.
pip install -r requirements.txt
Create a .env
file in the project root directory and add your Google Gemini API Key:
GOOGLE_API_KEY=your_google_gemini_api_key_here
Once everything is set up, run the application using:
streamlit run app.py
This will open a Streamlit web app in your default browser where you can upload PDFs and get instant summaries.
📁 pdf-summarizer/
│-- app.py # Main application file
│-- requirements.txt # List of dependencies
│-- .env # Environment variables (not shared in repo)
- Python
- Streamlit
- PyPDF2
- Google Gemini AI API
- python-dotenv
Issue: API Key not found error.
- Ensure the
.env
file is properly set up with the correct API key. - Run
echo $GOOGLE_API_KEY
(Linux/macOS) orecho %GOOGLE_API_KEY%
(Windows) to check if the environment variable is loaded.
Issue: Streamlit not launching.
- Ensure you have activated the virtual environment before running Streamlit.
- Try reinstalling dependencies using
pip install -r requirements.txt
.
Feel free to contribute! Fork the repository, make changes, and submit a pull request.
This project is licensed under the MIT License.
For any questions or issues, feel free to reach out via GitHub Issues. or mail to nidhishbalasubramanya@gmail.com