Text Classification
Transformers
ONNX
Safetensors
English
bert
political-discourse
media-bias
wording
contextual-review
text-embeddings-inference
Instructions to use Giuliocc/doxa-wording-encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Giuliocc/doxa-wording-encoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Giuliocc/doxa-wording-encoder")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Giuliocc/doxa-wording-encoder") model = AutoModelForSequenceClassification.from_pretrained("Giuliocc/doxa-wording-encoder", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 4,720 Bytes
b6e07f2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | # Contextual wording evaluation
The selected pipeline uses full encoder and classification head fine-tuning. Selection used validation macro-F1 after
the fixed search. The held-out cohort contains 384 upstream expert-majority
judgments in 227 article/source components.
| Pipeline | Test macro-F1 | Accuracy |
|---|---:|---:|
| word_tfidf | 0.716 | 0.716 |
| character_tfidf | 0.742 | 0.742 |
| word_character_tfidf | 0.724 | 0.724 |
| frozen_encoder_logistic | 0.745 | 0.745 |
| doxa_framing_control | 0.498 | 0.534 |
| Selected contextual pipeline | 0.789 | 0.789 |
| Quantized browser model | 0.784 | 0.784 |
The existing DOXA framing head is a task-mismatch proxy: its binary control
uses present/(present+absent), with original abstention states retained in
the JSON receipt. It was trained for the broader evaluative-framing review
criterion. The strongest control here was the character TF-IDF wording
classifier, so the reported improvement does not depend on that proxy.
The selected pipeline's gain over the strongest lexical/current-model control
was 0.0467. Its paired 95% source-group bootstrap
interval was [0.0027, 0.0924], using 2,000 draws.
The registered minimum gain was 0.02 with a positive lower bound.
The deployed quantized model's point gain over that control was
0.0415. Its separately reported 95%
group-bootstrap interval was
[-0.0044, 0.0885].
That interval includes zero. The native model's positive interval and the
registered quantization-parity gate support this provisional release;
standalone superiority of the browser export at 95% is not established.
Fine-tuning's observed macro-F1 difference from the frozen contextual pipeline
was 0.0441. Both contextual pipelines
were evaluated after validation selection. That comparison remains distinct
from the product promotion gate. The original gate and its pre-test amendment
are published alongside the export plan.
The initial matrix-only and default matrix-plus-embedding quantized exports
failed parity. After those held-out measurements, a bounded four-setting
exporter comparison used validation passages to select per-channel,
reduced-range QInt8. The final graph uses singleton inference matching the
browser. Learned weights, calibration and registered release thresholds
stayed fixed. EXPORT_REPAIR.md, EXPORT_VALIDATION.json and
EXPORT_ATTEMPTS.json preserve the process and failures. The export repair
occurred after initial held-out measurement; it is not a second untouched
model-selection experiment.
Quantized/native class agreement was 98.958%.
The quantized graph is 23,157,564 bytes. Browser/native
agreement was 100.000% over 128 deterministic cases.
Input above 256 tokens returns unresolved in the browser. Test input-limit
counts are recorded in EVALUATION.json. Scores were temperature-scaled on
validation and the uncertainty threshold was selected there. These model
scores need validation for additional populations and genres.
The temperature grid was fitted on the native validation outputs and chose
1.0, which leaves logits unchanged. The native validation outputs also chose
the 0.70 resolution threshold. The exported graph uses those same locked
settings; it has no separately fitted calibration. Its held-out Brier score
was 0.163, negative log likelihood
0.501 and 10-bin ECE
0.079. Its resolved coverage was
84.4%, with resolved macro-F1
0.818. These coverage figures are distinct from
full-cohort quality and are not model confidence guarantees.
## Data and interpretation
The benchmark contains human wording judgments from BABE. DOXA added no new
human annotations. It uses article URLs and exact/near-duplicate components
to separate roles. The same outlets can occur across roles. Source metadata
has known imperfections, including an upstream topic/link mismatch for case
`babe-sg2-00611`. This is an article-group evaluation within the collected
outlets, with those source limitations retained.
The input is the supplied sentence/passage text. Outlet, topic, source IDs,
annotators, reference labels and rationales stay outside the model input.
Additional document context has no supervised BABE wording label here.
English news is the evaluated genre. Academic papers, historical speech,
translation, other languages and different political settings require
separate validation. A wording flag can describe advocacy, criticism,
quotation or an allegation that is warranted in context.
No author ideology, prejudice category, factual-truth score or political
neutrality certification follows from this binary wording screen. Use the
other DOXA criteria and the original sources for their declared tasks.
Review disagreements and the ID-only error records before drawing a finding.
|