Inspiration
Every day, we consume thousands of words from news outlets, opinion editorials, and social media. Much of this discourse is subtly shaped by cognitive biases, emotional manipulation, and informal fallacies designed to nudge our perceptions without presenting sound evidence.
While fact-checkers verify whether a claim is statistically true or false, they miss the most insidious problem: a statement can be 100% factually accurate yet deeply manipulative through selective framing, loaded adjectives, and false dichotomies. We built BiasLens to act as an editorial precision instrument right in the browser—making cognitive manipulation visible while you read.
What it does
BiasLens is an editorial-grade Chrome browser extension powered by Google Gemini AI that scrutinizes webpages and text in real-time:
- 🎯 In-Situ Webpage Highlighting: Highlights manipulative sentences directly on the live webpage with color-coded annotations and interactive hover cards—even across hyperlinks and footnote citations.
- 🧬 13-Type Cognitive Bias Taxonomy: Detects Framing, Loaded Language, Appeal to Emotion, False Dichotomy, Ad Hominem, Straw Man, Slippery Slope, Cherry Picking, Whataboutism, and more.
- ⚖️ Neutrality Calibration Scale (0–100): Replaces generic AI progress rings with a calibrated linear index, diagnostic severity breakdown, and an interactive category radar chart.
- ✂️ Targeted Surgical Rewrites (LCS Word Diff): Unlike vague AI summaries that rewrite everything, BiasLens targets only the biased sentences, providing drop-in neutral replacements with an exact word-by-word diff while preserving all surrounding objective prose verbatim.
- 🔒 Deterministic & Fast: Locked to low-temperature sampling (temperature: 0.1) with bounded content-hash caching, so re-scanning identical articles is instantaneous with 0 redundant API calls.
- 🛡️ Privacy-First: Communicates directly with Google's official Gemini endpoint. Credentials and history remain exclusively in encrypted local browser storage (chrome.storage.local).
How we built it
How We Built It
- Browser Extension Architecture: Built with WXT on Manifest V3, leveraging Chrome's Side Panel API, Background Service Workers, and Content Scripts.
- Frontend UI & Craft: Built with React 18, TypeScript, and Tailwind CSS. Designed according to strict Impeccable craft rules—eliminating AI-slop anti-patterns (no gradient soup, no fitness-tracker circles, no nested card soup) in favor of high-contrast editorial typography and tactile segmented controls.
- AI Core: Integrated Google Gemini 2.0 & 1.5 Flash via @google/generative-ai with structured JSON schema outputs (RESPONSE_SCHEMA) for deterministic bias classification.
- Full-Page DOM Scrubber: Clones and sanitizes content trees up to 65,000 characters (~12,000 words), stripping out Tables of Contents, infoboxes, and edit buttons so 100% of the token budget is dedicated to the article prose.
- Diff & Highlighting Engine: Implemented custom Longest Common Subsequence (LCS) word-level diffing and multi-node DOM tree traversal to highlight text across complex formatting boundaries.
Challenges we ran into
- DOM Fragmentation on Live Webpages: Highlighting biased sentences in the DOM is notoriously hard because sentences frequently contain links, bold tags, or [1] citation superscripts, breaking them into separate Text nodes. We engineered a multi-node character offset traversal engine that bridges across formatting nodes without breaking webpage layouts.
- Boilerplate Eating Token Quotas: Wikipedia articles and news sites contain thousands of characters of Table of Contents links, infobox tables, and author sidebars. We built an out-of-DOM sandbox scrubber to eliminate boilerplate before sending text to the model.
- Avoiding Destructive AI Rewrites: Early prompts tried to rewrite entire articles, leading to hallucinations and altered neutral facts. We refined the pipeline into a surgical replacement model: non-biased text is preserved 100% verbatim, and only the biased sentences receive targeted neutral replacements with before/after word diffs.
Accomplishments that we're proud of
- Building a tool that analyzes up to 65,000 characters of full-page journalism in under 3.5 seconds. Achieving cross-element on-page highlighting that works seamlessly on complex Wikipedia pages.
- Crafting a distinctive, professional editorial interface that looks like a serious journalistic instrument rather than a generic AI wrapper.
- Making the extension completely private with local storage and direct API calls.
What we learned
- How subtle the line is between informative reporting and rhetorical framing, and how effectively structured LLM schemas can dissect informal logical fallacies.
- How to manage asynchronous Chrome Manifest V3 side panel communication and service worker lifecycles.
- How to achieve reproducible, deterministic LLM outputs using low-temperature constraints and content-hash caching.
What's next for BiasLens
- Cross-Source Perspective Comparison: Comparing how opposing news outlets (e.g., left vs. right) report on the exact same event side-by-side.
- Historical Rhetoric Tracker: A dashboard tracking which media outlets rely most heavily on emotional manipulation or fallacies over time.
- Cross-Browser Support: Expanding the Manifest V3 codebase to Firefox and Safari.
Built With
- ai
- chrome
- gemini-api
- google-gemini
- lucide-react
- machine-learning
- manifest-v3
- natural-language-processing
- react
- recharts
- tailwind-css
- typescript
- vite
- wxt
Log in or sign up for Devpost to join the conversation.