Inspiration
Most misinformation-detection tools hand you a single verdict — "real" or "fake" — with no way to see the reasoning behind it. That black-box approach felt backwards: if you can't inspect why something was flagged, you can't learn to spot it yourself next time. I wanted to build something that shows its work, the way a good editor marks up a manuscript rather than just rejecting it.
What it does
Margin takes any article — pasted text or a URL — and returns a 0–100 credibility score, broken into transparent, inspectable signals:
- Writing style — how closely the language matches measured, attributed reporting vs. sensational, unattributed claims (TF-IDF + cosine similarity)
- Sensational language density — trigger phrases, ALL-CAPS words, and exclamation marks per 100 words
- Sourcing & attribution — how often the text uses phrases like "according to," "confirmed," or "researchers said"
- Source domain reputation — when a URL is provided
The flagged phrases get annotated directly inline in the article, underlined like copy-editor's marginalia, and the verdict shows up as a rotated ink stamp: CREDIBLE, CAUTION, or LOW CREDIBILITY.
How we built it
Backend: Node.js + Express, with a TF-IDF and cosine-similarity engine written from scratch — no NLP dependency — comparing submitted text against two small reference corpora representing different writing registers
- Frontend: React + Vite + Tailwind CSS, designed around an "annotated manuscript" concept instead of a generic dashboard/gauge
- Optional: MySQL schema for logging analyzed articles
Challenges we ran into
Tuning the scoring weights so the signals stayed honest and explainable, rather than collapsing into an opaque single number, took the most iteration — I wanted every point of the score to be traceable back to a specific, visible reason in the text.
Accomplishments that we're proud of
Building a full explainable pipeline — not just a label, but inline, inspectable reasoning — solo, in a short window, on a stack I could move fast in.
What we learned
Concepts from classical information retrieval (TF-IDF, cosine similarity) are still genuinely useful, practical tools for real-world problems like this, not just exam material.
What's next for Margin
Expand the reference corpora and domain-reputation list for better accuracy
- Swap the hand-rolled TF-IDF for an embedding-based similarity model
- A browser extension so scoring happens on any page you're already reading
Built With
- cosine-similarity
- express.js
- html5
- javascript
- node.js
- react
- tailwindcss
- tf-idf
- vite