A fine-tuned version of Qwen3-8B for news media bias detection and neutral rewriting, developed by the Vector Institute as part of the UnBias-Plus project.
Given a news article, the model identifies biased language segments, classifies their bias type and severity, provides neutral replacements, and returns a fully rewritten unbiased version of the article — all in a single structured JSON response.
1from unsloth import FastLanguageModel
2import torch, json
34model, tokenizer = FastLanguageModel.from_pretrained(5"vector-institute/Qwen3-8B-UnBias-Plus-SFT",6 max_seq_length=8192,7 load_in_4bit=False,# set True for ~5GB VRAM (laptop)8 dtype=torch.bfloat16,9)10FastLanguageModel.for_inference(model)1112SYSTEM_PROMPT ="""You are an expert linguist and bias detection specialist.
13Your task is to carefully read a news article, detect ALL biased language,
14and return a structured JSON response. Return ONLY valid JSON, no extra text."""1516article ="Your news article here..."1718messages =[19{"role":"system","content": SYSTEM_PROMPT},20{"role":"user","content":f"Analyze the following article for bias and return the result in the required JSON format.\n\nARTICLE:\n{article}"},21]2223inputs = tokenizer.apply_chat_template(24 messages,25 tokenize=True,26 add_generation_prompt=True,27 enable_thinking=True,28 return_tensors="pt",29 return_dict=True,30)3132outputs = model.generate(33 input_ids=inputs["input_ids"].to("cuda"),34 attention_mask=inputs["attention_mask"].to("cuda"),35 max_new_tokens=4096,36 temperature=0.1,37 do_sample=True,38 pad_token_id=tokenizer.eos_token_id,39)4041new_tokens = outputs[0][inputs["input_ids"].shape[1]:]42response = tokenizer.decode(new_tokens, skip_special_tokens=True)4344# Extract JSON — strip thinking block if present45if"</think>"in response:46 response = response.split("</think>",1)[-1].strip()4748result = json.loads(response)
Trained primarily on English-language news articles
Political bias detection reflects patterns in the training data
Best performance on articles under 5000 characters
As with all language models, outputs should be reviewed by a human before use in production
Citation
If you use this model in your research or application, please cite:
@article{radwan2026unbias,
1 title={UnBias-Plus: Detect, Explain, and Rewrite Bias},
2 author={Radwan, Ahmed Y and ElKady, Ahmed and Chaduvula, Sindhuja and Hafez, Mohamed and Krishnan, Amrit and Raza, Shaina},
3 journal={arXiv preprint arXiv:2606.23412},
4 year={2026}
5}