Giuliocc's picture
Document task-specific local SDK, asset provenance and measured limits
2153e0a verified
|
Raw History Blame Contribute Delete
6.06 kB
metadata
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

DOXA contextual wording encoder

Check wording in a supplied English passage with a compact contextual model, then read the speaker, evidence and surrounding context. The selected model uses full encoder and classification head fine-tuning. Its original source task is BABE's expert-majority word-choice bias judgment. It returns a wording flag, no wording flag or an unresolved result under the published uncertainty threshold.

Use DOXA 路 TACITUS 路 GitHub 路 Benchmark 路 Evaluation and limits

The selected native pipeline reached 0.789 macro-F1 on 384 judgments from held-out source groups. Its gain over the strongest lexical or current DOXA control was 0.047, with paired 95% group-bootstrap interval [0.003, 0.092]. The quantized model reached 0.784. Inspect the complete control table, failures and coverage in the evaluation report. The quantized export's own 95% gain interval includes zero; its point gain and native-model parity support a provisional wording screen, with further independent evaluation needed.

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.

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 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 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 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 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 for data roles and independent evaluation requirements.