CoolFace
Apppublic

UserArkham/spectrum-news-bias-classifier

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

๐Ÿ—ž๏ธ Spectrum News Bias Classifier

A machine learning model that classifies political bias in news articles across the political spectrum.

Overview

The Spectrum model analyzes news content to determine political bias, helping users understand the political leaning of news sources and articles. It provides classifications from Left to Right on a 5-point scale.

Features

  • โ€”Political Bias Classification: Classifies news content on a 5-point political spectrum
  • โ€”Source Credibility Assessment: Evaluates the reliability of news sources
  • โ€”Confidence Scoring: Provides confidence levels for classifications
  • โ€”Multi-input Analysis: Analyzes headlines, article body, and source information

Bias Scale

  • โ€”1 - Left: Progressive, liberal perspectives
  • โ€”2 - Center-Left: Moderate liberal perspectives
  • โ€”3 - Center: Balanced, neutral reporting
  • โ€”4 - Center-Right: Moderate conservative perspectives
  • โ€”5 - Right: Conservative perspectives

Usage

Web Interface

The model is deployed with a Gradio interface that accepts:

  1. 1.News Headline (required): The main headline of the article
  2. 2.Article Body (optional): Full text content for more accurate analysis
  3. 3.Source Name (optional): News source for credibility cross-reference

API Endpoint

You can also use the model programmatically:

python
from app import classifier

result = classifier.classify_bias(
    headline="Your news headline here",
    body_text="Article content...",
    source_name="Source Name"
)

print(result)
# Output: {
#     "political_bias": "Center",
#     "confidence": 0.75,
#     "bias_score": 3,
#     "source_credibility": "High"
# }