Views
No views yet
hfl/chinese-roberta-wwm-ext-large 微调,用于判断中文段落是否由 AI 生成。| 来源 | 数量 | 标签 |
|---|---|---|
| PDF 学术论文提取(PyMuPDF) | 61,039 段 | Human |
| PaperPass 人类段落(score=0) | 3,843 段 | Human |
| PaperPass 疑似 AI(score≥50) | 3,343 段 | AI |
| LLM 生成(DeepSeek/GLM/Qwen/KIMI 等 8 个模型) | 27,317 段 | AI |
| Epoch | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| 1 | 93.7% | 87.9% | 95.0% | 91.3% |
| 2 | 95.4% | 95.7% | 90.7% | 93.1% |
| 3(最佳) | 96.5% | 94.0% | 96.2% | 95.1% |
| 来源 | 指标 | 结果 |
|---|---|---|
| PDF 人类文档 | 误判率(Human→AI) | 0.8% |
| LLM 生成 AI | 检出率 | 96.5% |
| PaperPass 强AI(score≥70) | 检出率 | 87.5% |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4tokenizer = AutoTokenizer.from_pretrained("yibo365/paperpass-v3")
5model = AutoModelForSequenceClassification.from_pretrained("yibo365/paperpass-v3")
6model.eval()
7
8text = "你要检测的段落文本..."
9inputs = tokenizer(text, return_tensors="pt", max_length=512, truncation=True)
10with torch.no_grad():
11 logits = model(**inputs).logits
12prob_ai = torch.softmax(logits, dim=-1)[0][1].item()
13print(f"AI 概率: {prob_ai:.4f}")| AI 概率 | 等级 |
|---|---|
| ≥ 0.70 | high(高度疑似 AI) |
| 0.40 - 0.70 | medium(疑似 AI) |
| 0.20 - 0.40 | low(轻度疑似) |
| < 0.20 | human(大概率人类) |