Downloads · 30 days
0
sxyyyy/disaster-tweet-triage
disaster-tweet-triage is a text classification model from sxyyyy. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
基于 Kaggle 比赛数据训练,仅限非商业用途。 Trained on Kaggle competition data. Non-commercial use only.
Downloads · 30 days
0
Access
Public
Updated Sep 24, 2026
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1 GB · 100%
From the Hugging Face model README
基于 Kaggle 比赛数据训练,仅限非商业用途。 Trained on Kaggle competition data. Non-commercial use only.
判断一条英文推文是否在报告真实灾害(标签 1 = 真实灾害,0 = 非灾害)。
这里是 disaster-tweet-triage 项目使用的模型,项目代码首次运行时会自动下载这些文件。
| 路径 | 内容 |
|---|---|
bert/ | 微调的 bert-base-uncased,默认编码器(≤ 512 token) |
modernbert/ | 微调的 ModernBERT-base,用于超过 512 token 的长文本(最长 8192 token) |
triage_calibration.json | 大模型复判的转交阈值(τ = 0.7)及其校准结果 |
本仓库不包含任何训练、验证或测试数据。
from transformers import AutoModelForSequenceClassification, AutoTokenizer
repo = "sxyyyy/disaster-tweet-triage"
tokenizer = AutoTokenizer.from_pretrained(repo, subfolder="bert")
model = AutoModelForSequenceClassification.from_pretrained(repo, subfolder="bert")
inputs = tokenizer(["Forest fire near La Ronge Sask. Canada"], return_tensors="pt")
probs = model(**inputs).logits.softmax(dim=-1) # 第 2 列为"真实灾害"的概率
训练时对文本做了规范化(还原 HTML 转义、链接替换为 http),推理时建议做同样的处理,
见项目中的 triage/preprocess.py。
train.csv,其中 id ≤ 8696 的 6090 条用于训练,其余 1523 条作为验证集。
训练集经过文本规范化、去除与验证集重复的样本、标签冲突多数投票和去重,最终为 5550 条。在验证集的另一半(报告半集,762 条,未参与任何选择)上:
| 模型 | 准确率 | Macro-F1 |
|---|---|---|
bert | 81.76 | 81.67 |
modernbert | 82.81 | 82.64 |
同一配置 3 个随机种子的 Macro-F1:BERT 81.63 ± 0.11,ModernBERT 81.70 ± 1.11,两者的差异在种子波动范围内。