A Python pipeline that scrapes news headlines, removes duplicate stories, clusters related articles, and ranks them to produce a clean and relevant news feed.
This project is designed for news aggregation systems where multiple publishers report the same event. The pipeline identifies duplicate or highly similar headlines and ranks the most important stories.
- News Scraping – Collect headlines from online sources
- Duplicate Detection – Identify similar or repeated stories
- Clustering – Group related news articles together
- Ranking System – Prioritize the most relevant stories
- Lightweight Pipeline – Simple modular Python architecture
news-deduplicator-ranking
│
├── scraper.py # Scrapes news headlines/articles
├── clustering.py # Clustering algorithm for grouping similar news
├── models.py # Data models used in the pipeline
├── main.py # Entry point for running the pipeline
│
├── __init__.py # Package initialization
│
├── pyproject.toml # Project dependencies and configuration
├── uv.lock # Dependency lock file
├── .python-version # Python version configuration
├── .gitignore
│
├── LICENSE
└── README.md
The pipeline follows these steps:
- Scrape News
scraper.pycollects headlines,text and url from news sources.
- Preprocess Data
- texts are cleaned and normalized.
- Cluster Similar Articles
- groups related stories using similarity measures.
- Rank Articles
- The remaining unique stories are ranked based on relevance or scoring logic.
- Deduplicate News
- Duplicate or near-duplicate headlines are removed.
Clone the repository:
git clone https://github.com/mundano17/news-deduplicator-ranking.git
cd news-deduplicator-rankingInstall dependencies:
uv syncRun the pipeline:
uv run main.py > output.txtThis will:
- Scrape news headlines
- Cluster related stories
- Remove duplicates
- Rank the final set of articles
- Original News

- Ranked News (not including the unique stories)

- Ranked + Deduplicated (has the unique stories as well)

- Python
- Text similarity algorithms
- Clustering techniques
- Web scraping
- Add clustering and ranking based on headlines
- Support better rss source validation
- Add real-time streaming pipeline
- Improve ranking using ML models
This project is licensed under the MIT License.
mundano17
GitHub: https://github.com/mundano17