UserArkham/spectrum-news-bias-classifier
0
๐๏ธ 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:
- News Headline (required): The main headline of the article
- Article Body (optional): Full text content for more accurate analysis
- Source Name (optional): News source for credibility cross-reference
API Endpoint
You can also use the model programmatically:
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"
# }
