A web application that allows users to summarize PDF files or text input using the Hugging Face facebook/bart-large-cnn model. Built with FastAPI for the backend and React + TailwindCSS for the frontend.
- Summarize text input or PDF documents.
- Multiple summary modes:
- Short – concise summary
- Medium – medium-length summary
- Detailed – detailed summary
- Handles large PDFs by splitting into chunks.
- Copy summary to clipboard.
- Real-time loading indicators while summarizing.
- Backend: FastAPI, PyPDF2, Transformers (Hugging Face)
- Frontend: React, TailwindCSS
- Communication: REST API (POST requests for summarization)
- CORS support for frontend-backend integration.
backend/ ├── main.py # FastAPI app ├── requirements.txt # Python dependencies └── README.md
frontend/ ├── src/ │ ├── components/ │ │ ├── FileUpload.jsx │ │ ├── ModeSelector.jsx │ │ └── SummaryBox.jsx │ ├── services/ │ │ └── api.js │ ├── pages/ │ │ └── Home.jsx │ └── index.css ├── package.json ├── tailwind.config.js ├── postcss.config.js └── vite.config.js
- Navigate to backend folder:
cd backend
pip install -r requirements.txt
uvicorn main:app --reload
The backend will start at: http://127.0.0.1:8000
/summarize – POST endpoint for text summarization.
/summarize-pdf – POST endpoint for PDF summarization.
2. Frontend
Navigate to frontend folder:
cd frontend
Install dependencies:
npm install
Start the development server:
npm run dev