This project automates the process of extracting, cleaning, and summarizing content from PDF files using Large Language Models (LLMs) via LangChain and Google Generative AI.
It then formats the output into a well-structured Word document (DOCX) with optional images — perfect for creating study notes, research summaries, or concise reports.
- 📘 PDF Text Extraction – Uses
pdfminer.sixto extract readable text from PDF files. - 🧹 Text Cleaning – Removes unwanted symbols, whitespace, and page artifacts.
- 🧩 Automatic Sectioning – Organizes text into logical sections based on headings or patterns.
- 🧠 AI Summarization – Summarizes each section using LangChain + Google Generative AI.
- 📝 Formatted Output – Generates a clean
.docxdocument with structured summaries. - 💾 Easy Export – Automatically saves and offers a download link for the final document.
Install the required dependencies before running the notebook:
pip install pdfminer.six langchain langchain_google_genai python-docxYou can also install them directly from within the notebook:
!pip install pdfminer.six langchain_google_genai python-docx langchainNote : API Key of an AI Model is required (recommended Gemini)
-
Clone the repository:
git clone https://github.com/maglesT/projects.git -
Add the API keys (Gemini)
-
Specify the PDF path
-
Run the notebook cells in order.
-
The notebook will:
- Extract and clean text from the PDF.
- Split it into sections.
- Generate AI-based summaries for each section.
- Export a formatted
.docxfile.
-
Summarized Note & Detailed Note will be generated in the root directory
- Python 3
- LangChain – for building summarization chains
- Google Generative AI – for large language model summarization
- pdfminer.six – for PDF text extraction
- python-docx – for document creation and formatting
This project is open source and available under the MIT License.