Text Classification
Transformers
ONNX
Safetensors
English
bert
political-discourse
media-bias
wording
contextual-review
text-embeddings-inference
Run this model with HF Jobs
Run Giuliocc/doxa-wording-encoder on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Giuliocc/doxa-wording-encoder. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Giuliocc/doxa-wording-encoder on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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: 6,287 Bytes
b6e07f2 01e0a36 c4d7fd3 01e0a36 c4d7fd3 01e0a36 ea41eec c4d7fd3 01e0a36 ea41eec 01e0a36 c4d7fd3 ea41eec c4d7fd3 b6e07f2 4eb6c46 b6e07f2 4eb6c46 b6e07f2 2153e0a | 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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | ---
language: en
license: apache-2.0
library_name: transformers
pipeline_tag: text-classification
base_model: sentence-transformers/all-MiniLM-L6-v2
datasets:
- Giuliocc/doxa-wording-benchmark
tags:
- political-discourse
- media-bias
- wording
- onnx
- contextual-review
---
## Role in TACITUS
`research-baseline`
## Do not use for
- Author ideology, prejudice-category, or factual-truth scoring
- Academic papers or non-news genres without separate validation
- Whole-document conclusions from a single sentence screen
- Political-neutrality certification or automatic rewriting mandates
- Treating unresolved browser answers as confident negatives
## Quickstart
Install dependencies, then pin this revision (`c4d7fd3e1312ff9e681d14153fb49aaeff80498e` was `main` when this Quickstart was written):
```bash
pip install -r requirements.txt
hf download Giuliocc/doxa-wording-encoder --revision c4d7fd3e1312ff9e681d14153fb49aaeff80498e --local-dir ./doxa-wording-encoder
```
```python
import sys
from huggingface_hub import snapshot_download
revision = "c4d7fd3e1312ff9e681d14153fb49aaeff80498e"
path = snapshot_download("Giuliocc/doxa-wording-encoder", revision=revision)
sys.path.insert(0, path)
from inference import WordingModel
print(WordingModel(path).check("The committee voted six to four to approve the policy."))
```
## Local inference
The browser uses the checked quantized ONNX graph and tokenizer, totaling
about 23.2 MB of model weights.
Inference runs locally after the public asset download. The Python
`inference.py` helper uses ONNX Runtime and the published runtime manifest.
The native Transformer head returns two class logits. The helper and browser
apply the validation temperature and uncertainty threshold, and retain input
limits in their structured result.
To reproduce the published predictions exactly, install `numpy==2.5.5`,
`onnxruntime==1.22.0` and `tokenizers==0.21.4` (see `requirements.txt`). An independent
re-run with those versions matched all 384 published test predictions with a maximum
score difference of 0. With `onnxruntime` 1.32 and `tokenizers` 0.23, scores moved by up
to 0.046 and two borderline cases changed decision.
```python
from inference import WordingModel
model = WordingModel("path/to/downloaded/model")
result = model.check("The committee voted six to four to approve the policy.")
print(result)
```
`model_score` is the positive wording class's score after validation
temperature scaling. The output records that calibration method, resolution
threshold and actual token count. Input longer than 256 tokens is unresolved.
Long documents require passage selection and source context, as in DOXA Lab.
The [fictional illustrations](illustrations.json) contain actual outputs and
retain their authored provenance.
## Training and source provenance
The benchmark's 3,639 admitted judgments retain original expert votes,
strict majority admission and source-group roles. Article text was restored
locally from the pinned upstream source for training. Public model artifacts
contain IDs and predictions in place of article excerpts. The original
source's licenses and article rights are documented by the benchmark.
The base encoder is pinned at
`1110a243fdf4706b3f48f1d95db1a4f5529b4d41` under Apache-2.0. Training used
local CPU compute, seed 1729 and zero new spend. The registration, amendment,
export plan, training history and code are included. Reproduction needs the
DOXA project source, the benchmark restoration recipe and the pinned Python
dependencies. Keep restored article text in the local benchmark workspace.
See [REPRODUCE.md](REPRODUCE.md) for the complete experiment and export steps.
The public benchmark release is pinned at
`bea9a3f2d53b03069b0d814094ea860d75f1c322` (tag `v0.1.0`).
The admitted split contains 2,950 training, 305 validation and 384 held-out
judgments. Fixed search used learning rates 2e-5 and 5e-5, three epochs
each, AdamW, balanced cross entropy and 256-token input. Validation selected
learning rate 5e-5 at epoch 2. Candidate and frozen controls use the passage
text alone; annotator votes, source, outlet and topic stay outside features.
## Scope
This is a provisional wording screen for contextual review. Its evaluated
genre is sampled English news. Academic papers and other domains need
separate validation. A positive wording judgment can occur in legitimate
criticism, declared advocacy or attributed speech. Read the original source
and preserve supported political meaning when considering a revision.
The current dataset supports a binary wording task. Other prejudice,
research-validity and comparative-bias questions need their own evidence
and labels. The same news outlets can occur in training and test roles, and
known source-URL imperfections remain documented. Additional independent
evaluation is needed before broad service-quality claims.
## Local SDK and provenance contract
The [DOXA Methods foundation](https://huggingface.co/datasets/Giuliocc/doxa-methods) supplies a common local request/result envelope, exact-commit asset loader and checked source/reviewer schemas. This model retains its native task and output labels: `biased_wording`. Its recorded portfolio status is `qualified_news_wording_research`.
The [task manifest](portfolio-task.json) pins the existing inference artifact and expected hashes. Run it with the Methods SDK using `doxa portfolio fetch` and `doxa portfolio run`. Document text stays local; fetching public weights does not provide hosted inference. This update changes documentation and contracts; learned parameters are unchanged.
Scope boundaries:
- English news wording task.
- No supervised surrounding-article context.
- Input above256tokens unresolved.
- Browser improvement interval includes zero.
- Academic/prejudice/whole-document conclusions require separate validation.
Source judgments, model predictions and actual human review remain separate. The production new-reviewer registry starts empty. This model does not certify political neutrality, infer a person's beliefs or supply an overall political-bias percentage. See the [research foundation guide](https://huggingface.co/spaces/Giuliocc/doxa-lab/blob/main/RESEARCH_FOUNDATION.md) for data roles and independent evaluation requirements.
|