Extractive Text Summarization with Python & NLTK
An educational Python project that implements Extractive Text Summarization using the Natural Language Toolkit (NLTK).
The application analyzes a text, calculates word frequencies, scores every sentence, and automatically generates a concise summary by selecting the most relevant sentences.
This project was developed as part of a Python course project.
The objective is to implement an extractive text summarization algorithm without using machine learning or AI models.
Instead, the algorithm relies on classical Natural Language Processing (NLP) techniques provided by the NLTK library.
- Read text files
- Tokenize text
- Remove punctuation
- Remove English stopwords
- Calculate word frequencies
- Normalize word frequencies
- Split text into sentences
- Calculate sentence scores
- Select the top 20% highest-ranked sentences
- Generate an extractive text summary
PythonProjekt/
│
├── data/
│ └── ClimateScienceText.txt
│
├── src/
│ ├── utils.py
│ ├── tokenizer.py
│ ├── frequency.py
│ ├── summarizer.py
│ └── main.py
│
├── requirements.txt
├── SUMMARY.md
└── README.md
- Python 3
- NLTK
- Dictionaries
- Functions
- Modular Programming
- Natural Language Processing (NLP)
Read Text
│
▼
Tokenization
│
▼
Remove Stopwords
│
▼
Calculate Word Frequencies
│
▼
Normalize Frequencies
│
▼
Split into Sentences
│
▼
Calculate Sentence Scores
│
▼
Select Top 20%
│
▼
Generate Summary
Clone the repository
git clone https://github.com/fdeniz07/PythonProjekt.gitOpen the project
cd PythonProjektCreate a virtual environment
python -m venv .venv
.venv\Scripts\activateInstall dependencies
pip install -r requirements.txtpython src/main.py================================================================================
SUMMARY
================================================================================
Climate science is a vast and multifaceted discipline...
Understanding the drivers of climate change...
Renewable energy technologies...
Climate science informs urban planning...
Climate science is a vital and indispensable field...
This project demonstrates:
- Text preprocessing
- Tokenization
- Stopword removal
- Dictionary usage
- Frequency analysis
- Sentence scoring
- Extractive summarization
- Modular software design
- Clean code principles
Additional documentation is available in:
SUMMARY.md
- Support for multiple languages
- PDF document summarization
- Graphical user interface (Tkinter or PySide)
- Adjustable summary percentage
- Command-line arguments
- Export summary to TXT or PDF
- Web API with FastAPI
- Web application with Flask
Fatih Deniz
Software Developer
GitHub: https://github.com/fdeniz07
This project was created for educational purposes.