"""Central configuration for the conspiracy language classifier.""" CONFIG = { # Model — XLM-RoBERTa-base: right-sized for ~20k samples, avoids overfitting "model_name": "xlm-roberta-base", "max_length": 256, "num_labels": 2, # LoRA "lora_r": 256, "lora_alpha": 512, "lora_dropout": 0.05, "lora_target_modules": ["query", "value"], # Training "learning_rate": 2e-5, "weight_decay": 0.01, "num_epochs": 4, "per_device_train_batch_size": 16, "gradient_accumulation_steps": 1, "warmup_ratio": 0.1, "max_grad_norm": 1.0, "fp16": "auto", "bf16": "auto", "gradient_checkpointing": False, # Early stopping "early_stopping_patience": 2, "early_stopping_metric": "eval_f1", # Data "covid_debias_prob": 0.4, "max_supplement_samples": 20000, "val_ratio": 0.1, "test_ratio": 0.1, "covid_test_size": 500, "seed": 42, # Paths "output_dir": "./results", "logging_dir": "./logs", } # COVID-specific terms grouped by category for debiasing COVID_TERMS = { "disease_name": [ "covid-19", "covid", "coronavirus", "sars-cov-2", "corona virus", "the virus", "the pandemic", "pandemic", "epidemic", ], "treatment": [ "vaccine", "vaccination", "vaccines", "vaccinations", "vax", "vaxx", "pfizer", "moderna", "astrazeneca", "johnson & johnson", "j&j", "booster", "boosters", "mrna", "spike protein", "jab", "ivermectin", "hydroxychloroquine", ], "authority_figure": [ "fauci", "dr. fauci", "dr fauci", "anthony fauci", "bill gates", "gates", "tedros", ], "organization": [ "cdc", "who", "world health organization", "centers for disease control", "nih", "fda", "big pharma", "pharmaceutical companies", ], "location": [ "wuhan", "china", "chinese", "wuhan lab", ], "measure": [ "lockdown", "lockdowns", "quarantine", "mask mandate", "social distancing", "stay-at-home order", "shelter in place", "contact tracing", ], "concept": [ "gain of function", "lab leak", "wet market", "china virus", "plandemic", "scamdemic", "herd immunity", ], } # Generic replacements per category REPLACEMENTS = { "disease_name": [ "the disease", "the illness", "the outbreak", "the health crisis", "the epidemic", "the infection", ], "treatment": [ "the treatment", "the medicine", "the remedy", "the therapy", "the drug", "the cure", "the injection", ], "authority_figure": [ "the official", "the director", "the leader", "the authority", "the public figure", "the expert", ], "organization": [ "the agency", "the institution", "the organization", "the health authority", "the regulatory body", ], "location": [ "the region", "the area", "the country", "the foreign lab", ], "measure": [ "the policy", "the restriction", "the mandate", "the regulation", "the government order", "the safety measure", ], "concept": [ "the cover-up", "the secret program", "the hidden agenda", "the conspiracy", "the scheme", ], }