The Document Summarizer leverages Hugging Face’s facebook/bart-large-cnn model to simplify the process of summarizing lengthy documents. This app allows users to upload PDF or plain text files and generates concise, human-readable summaries. It combines a ReactJS (Vite) frontend with a Flask backend for efficient processing.
- File Upload Support: Accepts both
.pdf
and.txt
files for summarization. - Concise Summaries: Generates readable and concise summaries of lengthy documents.
- Secure Processing: Files are temporarily stored during processing and deleted after use.
- Modern Technology Stack:
- Frontend: ReactJS and Vite.
- Backend: Flask.
- Summarization: Hugging Face’s
facebook/bart-large-cnn
.
- ReactJS with Vite for responsive and fast UI.
- Axios for API requests.
- Flask for API handling and text processing.
- pdfplumber for extracting text from PDF files.
- Hugging Face’s facebook/bart-large-cnn for abstractive text summarization.
git clone git@github.com:allanninal/document-summarizer.git
cd document-summarizer
-
Create and activate a virtual environment:
python3.12 -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows
-
Install dependencies using
requirements.txt
from the backend folder:pip install -r backend/requirements.txt
-
Run the Flask backend:
python backend/app.py
-
Navigate to the
frontend
directory:cd frontend
-
Install dependencies:
npm install
-
Start the React development server:
npm run dev
Visit the app at http://localhost:5173
.
- Upload a Document: Upload
.pdf
or.txt
files through the frontend. - Text Extraction: The backend extracts text using
pdfplumber
or reads plain text files. - Summarization: The extracted text is processed through Hugging Face’s
facebook/bart-large-cnn
model to generate a concise summary. - Display Results: The frontend displays the summary in real time.
- Support for Large Documents: Chunk large files and summarize them section by section.
- Multilingual Summarization: Add support for non-English texts using multilingual models.
- Save Summaries: Enable users to download summaries in
.txt
or.pdf
formats. - Enhanced UI/UX: Add drag-and-drop file upload and progress indicators.
- Customizable Summaries: Allow users to choose between short, medium, or detailed summaries.
This project is licensed under the MIT License. See the LICENSE
file for details.
If you find this project helpful, consider supporting me on Ko-fi:
ko-fi.com/allanninal
For more exciting projects, check out my list of AI Mini Projects:
Mini AI Projects GitHub List