Inspiration

Statistical illiteracy is a critical vulnerability. News articles weaponize data. They confuse correlation with causation and hide weak evidence behind vague language. Most fact-checkers flag errors but don't teach why they matter. After seeing viral articles like "wine equals gym time" spread unchecked, I built a reasoning engine that trains your BS detector, not just detects problems.

What it does

Nuance combines Claude's semantic understanding with deterministic Python validation to audit statistical claims: Semantic Extraction: Claude extracts claims into strict Pydantic-validated JSON Statistical Validation: 7 deterministic checks (correlation vs causation, sample size disclosure, base rate neglect, relative risk without context, etc.) Educational Synthesis: Claude explains why issues matter Think-Before-Reveal Mode: Gamified learning where you predict which checks fail, then get accuracy scoring (precision/recall/F1).

How we built it

Tech stack: Python, Anthropic Claude API (Sonnet), Streamlit, Pydantic, pytest Key decisions: Guardrails pattern: Pydantic validation errors feed back to Claude for self-correction (3 retries) Neuro-symbolic split: LLMs handle semantics, Python handles math (reproducible + explainable) Test-driven: 5 test files covering edge cases before finalizing features AI-assisted coding: Used Claude Code to assist the coding

Challenges we ran into

JSON hallucination: Solved with retry mechanism using Pydantic errors as feedback False positives: "Increased by 300%" was flagged as "missing comparator" even though baseline is implicit. Added pattern detection to exclude valid cases. LLM math inconsistency: Removed ALL math from LLM. Python calculates metrics deterministically. State management: Streamlit's stateless nature complicated Think-Before-Reveal. Solved with session_state.

Accomplishments that we're proud of

  1. Neuro-symbolic architecture that actually works in production
  2. Robust retry mechanism turning validation errors into self-correction
  3. Think-Before-Reveal mode with accuracy scoring (first time implementing active learning)
  4. 100% test suite pass rate (20+ test cases)
  5. Correctly identified all issues in viral "wine = exercise" article ##What we learned Technical: LLMs + deterministic logic beats either alone. Pydantic errors are detailed enough to guide LLM self-correction. Real-world examples make better tests than synthetic ones. Design: Active prediction (Think-Before-Reveal) beats passive reading. Explaining why builds lasting skills. Transparency builds trust. Process: Test-driven development clarified "correct" behavior. Documentation is a feature, not afterthought. ##What's next for Nuance Short-term: Browser extension for real-time auditing, expanded checks (Simpson's Paradox, p-hacking), collaborative leaderboard Medium-term: Multi-language support, citation network analysis Long-term: Educational platform with curriculum for critical thinking courses, integration with fact-checking organizations (PolitiFact, Snopes)

Built With

  • claude
  • pydantic
  • pytest
  • python
  • streamlit
Share this project:

Updates

Submission history