A Streamlit application that summarizes multiple academic journal PDFs using both extractive and abstractive summarization techniques. This tool helps researchers and students quickly grasp the key points from multiple academic papers.
- Upload multiple PDF documents simultaneously
- Extract text content from PDF files
- Preprocess text to remove stopwords and noise
- Two summarization modes:
- Extractive summarization using LSA (Latent Semantic Analysis)
- Abstractive summarization using BART (facebook/bart-large-cnn)
- Interactive web interface built with Streamlit
- Clone the repository:
git clone <https://github.com/EngRidhoNet/summarization_streamlit>
cd multi-document-summarizer- Install required dependencies:
pip install -r requirements.txt- Download NLTK resources:
python -m nltk.downloader stopwords
python -m nltk.downloader punkt- Python 3.7+
- NLTK
- Sumy
- Transformers
- Streamlit
- PyPDF2
- torch
Create a requirements.txt file with the following:
nltk
sumy
transformers
streamlit
PyPDF2
torch
- Start the application:
streamlit run app.py-
Access the web interface through your browser (typically http://localhost:8501)
-
Upload your PDF files using the file uploader
-
Select your preferred summarization mode:
- Extractive: Uses LSA to extract key sentences from the text
- Abstractive: Uses BART to generate a new summary
-
Click "Summarize" to process the documents
├── app.py # Main application file
├── requirements.txt # Project dependencies
└── README.md # Documentation
extract_text_from_pdf(pdf_file): Extracts text content from uploaded PDF filespreprocess_text(text): Removes stopwords and performs basic text cleaningextractive_summarization(text, ratio): Performs LSA-based extractive summarizationabstractive_summarization(text, max_length, min_length): Performs BART-based abstractive summarizationmulti_document_summarization(journals, mode): Handles multiple document summarization
The application uses several configurable parameters:
- Extractive summarization ratio: 0.2 (20% of original text)
- Abstractive summarization:
- Maximum length: 130 tokens
- Minimum length: 30 tokens
- NLTK data path: Customize in the code according to your environment
Common issues and solutions:
-
NLTK Resource Error:
- Ensure NLTK resources are properly downloaded
- Check NLTK data path configuration
-
PDF Extraction Issues:
- Verify PDF is not encrypted
- Check PDF file permissions
- Ensure PDF contains extractable text
-
Memory Issues:
- Reduce batch size of documents
- Process larger documents individually
- Maximum token limit for abstractive summarization: 1024 tokens
- PDF must contain extractable text (non-scanned documents)
- Processing time increases with document length and quantity
Contributions are welcome! Please feel free to submit a Pull Request.