Downloads · 30 days
5
18% of all-time downloads
guoer9/qwen3-8b-news-classifier
qwen3-8b-news-classifier is a text classification model from guoer9. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
基于 Qwen3-8B 微调的中文新闻分类模型,在 TNEWS 数据集上达到 62.4% 准确率,超越 ERNIE 3.0 Titan (260B) 等 SOTA 模型。
Downloads · 30 days
5
18% of all-time downloads
All-time downloads
28
Public
Parameters
8.2B
16.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.4 GB · 100%
From the Hugging Face model README
基于 Qwen3-8B 微调的中文新闻分类模型,在 TNEWS 数据集上达到 62.4% 准确率,超越 ERNIE 3.0 Titan (260B) 等 SOTA 模型。
| 模型 | TNEWS 准确率 | 对比 |
|---|---|---|
| BERT-base | 56.1% | 本模型更高 +6.3% |
| RoBERTa-large | 58.4% | 本模型更高 +4.0% |
| ERNIE 3.0 | 59.5% | 本模型更高 +2.9% |
| ERNIE 3.0 Titan (260B) | 60.1% | 本模型更高 +2.3% |
| 本模型 (Qwen3-8B LoRA) | 62.4% | 超越 SOTA ✅ |
| GPT-4 | ~68% | 略低 -5.6% |
| 步数 | eval_loss | 变化 |
|---|---|---|
| 100 | 0.856 | - |
| 300 | 0.823 | -0.033 |
| 500 | 0.811 | -0.012 |
| 1000 | 0.798 | -0.013 |
| 2000 | 0.783 | -0.015 |
| 3000 | ~0.78 | 基本收敛 |
| 模型 | 输出质量 | 格式 |
|---|---|---|
| 基础模型 | ✅ 能识别,输出冗长 | ❌ 不直接输出JSON |
| 微调模型 | ✅ 能识别,输出简洁 | ✅ 直接输出JSON |
| 参数 | 值 |
|---|---|
| 基础模型 | Qwen/Qwen3-8B |
| 参数量 | 8B |
| 微调方法 | LoRA |
| LoRA rank | 64 |
| LoRA alpha | 128 |
| LoRA dropout | 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| 参数 | 值 |
|---|---|
| Epochs | 3 |
| Batch size | 8 |
| Gradient accumulation | 2 |
| Effective batch size | 16 |
| Learning rate | 5e-5 |
| LR scheduler | Cosine |
| Warmup ratio | 0.03 |
| Optimizer | AdamW |
| Weight decay | 0.01 |
| Max grad norm | 1.0 |
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"guoer9/qwen3-8b-news-classifier",
device_map="auto",
torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained("guoer9/qwen3-8b-news-classifier")
messages = [
{"role": "user", "content": "请对以下新闻进行分类:央行今日宣布降息25个基点,市场反应积极。"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
本模型已在 Kubernetes 集群上成功部署,支持:
| 任务 | 基础模型 | 微调模型 | 专业模型 |
|---|---|---|---|
| 新闻分类 | ~40% | 62.4% ✅ | 60% (ERNIE) |
| 实体识别 | 格式差 | 格式好 ✅ | 90%+ (专业NER) |
Apache 2.0