Skip to content
Myklob edited this page Aug 10, 2025 · 4 revisions

Truth Score: Integrating Logical Fallacy and Evidence Verification Scores

The Truth Score quantifies the strength of an argument by combining two key measures:

  1. Logical Fallacy Score – Evaluates the extent to which an argument relies on logical fallacies.
  2. Evidence Verification Score – Measures how strongly a claim is supported by independent, replicable evidence (e.g., blind studies, scenario comparisons).

By integrating these scores, we can more accurately assess the rationality and validity of an argument.


Why This Matters

  • Logical integrity: Detect and weigh the use of common fallacies.
  • Empirical validation: Reward arguments supported by verified data.
  • Better group decision-making: Stronger foundations for policy, public opinion, and collaboration.

Common Logical Fallacies

  • Ad hominem – Attacking the person instead of the argument.
  • Appeal to authority – Relying solely on authority without evidence.
  • Red herring – Distracting from the main issue with irrelevant points.
  • False cause – Mistaking correlation for causation.

Algorithm Outline

  1. Maintain a comprehensive list of recognized logical fallacies.
  2. Allow users to flag arguments for potential fallacies.
  3. Enable discussion for and against each fallacy accusation.
  4. Auto-flag similar arguments using semantic equivalency.
  5. Use ML to detect linguistic patterns associated with fallacies.
  6. Score flagged arguments based on supporting/opposing sub-arguments.
  7. Aggregate results into a Logical Fallacy Score (confidence interval).

Example Code: Basic Logical Fallacy Scoring

logical_fallacies = ['ad hominem', 'appeal to authority', 'red herring', 'false cause']
argument_scores = {}

def evaluate_sub_argument_score(argument, fallacy, evidence):
    score = 0
    # TODO: Implement scoring logic using evidence
    return score

def evaluate_argument_score(argument, evidence):
    score = 0
    for fallacy in logical_fallacies:
        score += evaluate_sub_argument_score(argument, fallacy, evidence.get(fallacy, []))
    return score

flagged_arguments = {}  # {argument: {fallacy_type: [evidence_items]}}
similar_arguments = {}  # Placeholder for auto-flagging system

class FallacyDetector:
    def detect(self, argument):
        # TODO: Implement ML detection
        return []

fallacy_detector = FallacyDetector()

for argument, evidence in flagged_arguments.items():
    score = evaluate_argument_score(argument, evidence)
    if score < -2:
        confidence = "Very likely fallacious"
    elif score < 0:
        confidence = "Possibly fallacious"
    elif score == 0:
        confidence = "No indication of fallacy"
    elif score < 2:
        confidence = "Possibly sound"
    else:
        confidence = "Very likely sound"
    argument_scores[argument] = {'score': score, 'confidence_interval': confidence}

Example Code: Enhanced Fallacy Detector

import re
import spacy

class ImprovedFallacyDetector:
    def __init__(self):
        self.nlp = spacy.load("en_core_web_sm")
        self.fallacies = {
            'ad hominem': ['ad hominem', 'personal attack', 'character assassination'],
            'appeal to authority': ['appeal to authority', 'argument from authority', 'expert opinion'],
            'red herring': ['red herring', 'diversion', 'distract', 'sidetrack'],
            'false cause': ['false cause', 'post hoc', 'correlation is not causation', 'causal fallacy']
        }
        self.patterns = {
            f: re.compile(r'\b(?:%s)\b' % '|'.join(k), re.IGNORECASE)
            for f, k in self.fallacies.items()
        }

    def detect_fallacy(self, text):
        results = {}
        doc = self.nlp(text)
        for sent in doc.sents:
            for fallacy, pattern in self.patterns.items():
                if pattern.search(sent.text):
                    results.setdefault(fallacy, []).append(sent.text)
        return results

# Example usage
detector = ImprovedFallacyDetector()
examples = [
    "You can't trust anything he says because he's a convicted criminal.",
    "Dr. Smith said it, so it must be true.",
    "I know I made a mistake, but what about all the good things I've done for the company?",
    "I wore my lucky socks, and then we won the game, so my socks must have caused the win."
]

for text in examples:
    print(detector.detect_fallacy(text))

Future Development

  1. Large, diverse dataset – Train ML models on fallacy examples from multiple domains/media types.
  2. Domain-specific tuning – Adjust algorithms for political, scientific, or commercial contexts.
  3. Human feedback loop – Let users flag, verify, or reject fallacy identifications.
  4. Continuous refinement – Iteratively improve detection accuracy and scoring fairness.

See Also:

Clone this wiki locally