All 286 ayahs of Al-Baqarah, embedded with BAAI/bge-m3 (verse + tafsir concatenated) and classified via k-NN similarity-weighted voting (k=5, threshold=0.4) against 19 hand-labeled anchor verses spanning the 6 core classes. Projected to 2D with t-SNE / PCA. Shows Al-Baqarah's own 286 verses only by default — the 19 reference "anchor" verses used to seed the classifier (drawn from other surahs, e.g. Al-Ikhlas) are hidden; toggle "+ anchor verses" to bring them back and see what each cluster is anchored to. All 6 classes render at once, each with both its own color and its own marker shape (so identity never depends on color alone — readable even in grayscale or by colorblind viewers). Click a legend chip to isolate one class, or "Show all classes" to bring everything back.
Filterable table — the accessibility relief for the scatter plot above (identity is never color-alone).
What this shows: a real production run of the pipeline against this project's own ingested Quran +
tafsir data (Postgres, quran-postgres) — not mock data. Tafsir source is Tafsir al-Jalalayn
(best coverage for Surah 2: 284/286 ayahs, and notably concise — ~500 chars avg vs. Ibn Kathir's ~7,400 — which
keeps the verse signal from being diluted in the verse+tafsir concatenation). Ayahs 2:47 and 2:134 have no
tafsir in any of the 5 ingested books; the pipeline's existing fallback (verse text only) handled this
gracefully, exactly as designed.
Why the "Unclassified" rate is high: the 19 anchors were written as short, thematically pure example verses (mock data from the original demo) — they're good gravity wells for verses that closely resemble them, but Al-Baqarah's actual content is dominated by long narrative ayahs (the Calf, the Cow, Bani Israel's covenant) that blend multiple themes at once or don't strongly resemble any single anchor. This is a property of the anchor set's coverage, not a pipeline bug — the classifier is correctly declining to force a label when evidence is thin, per the 0.4 similarity-weighted-vote threshold.
What would improve coverage: (1) more anchors per class (19 total across 6 classes is sparse for a 286-verse target corpus), (2) anchors drawn from Al-Baqarah itself or similarly narrative-heavy verses rather than short "pure" examples, (3) a lower threshold traded against precision, calibrated per-class on a held-out labeled set as described in the classifier's docstring.
Reading the map: ● Theology and ✚ Jurisprudence anchors cluster tightly and pull in a visible halo of nearby verses — Al-Baqarah's opening theology (2:1-20) and its dense legal sections (fasting, divorce, retribution, the famous 2:282 debt verse) both have strong anchor support. The Bani Israel narrative block (roughly 2:40-103) reads as a diffuse cloud between Prophethood and Death/Eschatology anchors, rarely landing squarely on either — exactly the "blended theme, thin anchor coverage" case above.