feat/improved bias calculation#29
Merged
Merged
Conversation
|
jomkv
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Major changes:
BIAS IMPLEMENTATION
A. Bias Divergence (The "Echo Chamber" Detector)
Goal: Measures how diverse your source set is.
The Logic: It looks at the spread of news sources across the political spectrum (from Left to Right).
The Math: It calculates the Standard Deviation of all source bias values. If all sources are in the same location (e.g., all are "Left-Center"), the deviation is 0. If they are spread from far-left to far-right, the deviation is high.
The Scale:
1.0 (Maximum Divergence): You have a perfectly represented sample of the whole political spectrum.
-1.0 (Minimum Divergence): You are in an echo chamber; all sources share the same ideological lean.
B. Bias Consistency (The "Polarization" Detector)
Goal: Detects if sources are "picking sides" based on their politics.
The Logic: It calculates the correlation between a source's lean and the verdict they gave.
The Math: It uses the Absolute Pearson Correlation Coefficient (r).
If Left sources always say "Support" and Right sources always say "Refute," then r is 1.0.
If their verdicts have nothing to do with their bias (e.g., everyone agrees or the disagreement is random), r is 0.0.
The Scale:
1.0 (High Consistency/Polarization): The claim is highly partisan. Ideology is a perfect predictor of the verdict.
-1.0 (No Consistency): There is no partisan pattern. The media is either in consensus or the disagreement is not driven by bias.