This application allows users to upload PDF documents, extract highlights, and generate summaries. The highlights are extracted using context from the document and then summarized them. Afterward, the summary is displayed and can be downloaded as a PDF.
The application leverages Groq’s LLM API for summarization and uses Streamlit to provide an interactive user interface.
- Streamlit: For building the interactive web interface.
- Groq: Provides the API for advanced language models (LLM) used for summarization.
- LangGraph: Used to handle highlight extraction and summarization with Groq LLM.
Here’s a visual representation of the LangGraph workflow used for processing and summarizing the highlights:
- User Uploads PDF: The user uploads a PDF document via Streamlit's file uploader.
- Highlight Extraction: The application scans the PDF, extracts any highlights, and gathers surrounding context.
- Summarization: The extracted highlights and context are then processed and summarized using LangGraph with the help of Groq's LLM.
- Display & Download: The summary is displayed in the Streamlit app, and users can download it as a PDF.
First, clone this repository to your local machine:
git clone <repository_url>
cd <repository_directory>Ensure you have all the dependencies installed:
pip install -r requirements.txtYou will need a Groq API key to access their LLM. You can sign up for an account at Groq and generate your API key.
In the root directory of the project, create a .env file to store your Groq API key. The .env file should contain the following:
GROQ_API_KEY=your_groq_api_key_here
Replace your_groq_api_key_here with the actual Groq API key you received.
After setting everything up, you can start the Streamlit app:
streamlit run streamlit.pyThis will launch a local development server and open the application in your web browser.
- Upload a PDF file using the file uploader.
- The app will process the file, extract highlights, summarize them, and display the summary on the page.
- You can download the generated summary as a PDF file.
├── .env # Contains your Groq API key
├── streamlit.py # Streamlit application
├── summarizing_highlights.py # Script for highlight extraction and summarization
├── requirements.txt # List of dependencies
└── README.md # This file
- Streamlit: For building the interactive web interface.
- LangGraph: Used to handle highlight extraction and summarization with Groq LLM.
- Groq: Provides the API for advanced language models (LLM) used for summarization.
- PyMuPDF: For text extraction from PDF files.
- FPDF: For generating downloadable PDF files with the summary.
Feel free to fork the repository and submit pull requests for any enhancements or bug fixes.



