📊 Bag of Words vs TF-IDF
An interactive 3D bar-chart lab comparing raw Bag-of-Words counts against TF-IDF weighted scores across a small document corpus, showing exactly how rarity-based weighting suppresses common words.
A 3D bar chart grid — one row per document, one column per vocabulary word — lets you switch between raw Bag-of-Words counts and TF-IDF weighted scores, and watch common words collapse as the simulated corpus grows.
🔬 What It Demonstrates
Bag-of-Words treats every occurrence equally, so filler words like "the" tower over rare, meaning-carrying words. TF-IDF multiplies each count by an inverse-document-frequency weight, shrinking common words and boosting distinctive ones.
🎮 How to Use
Toggle between Bag-of-Words and TF-IDF, pick which document to highlight, and drag the corpus-size slider to see how adding more documents pushes down the idf weight — and bar height — of common words in real time.
💡 Did You Know?
TF-IDF was introduced by Karen Spärck Jones in 1972 and still underlies many production spam filters and search-ranking systems today, decades before deep learning embeddings existed.
An interactive 3D bar-chart lab comparing raw Bag-of-Words counts against TF-IDF weighted scores across a small document corpus, showing exactly how rarity-based weighting suppresses common words.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install