bert-disaster-tweets
bert-base-uncased fine-tuned on Kaggle
Natural Language Processing with Disaster Tweets
to classify whether a tweet is about a real disaster (disaster, label 1) or not (not_disaster, label 0).
| Split | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|
| Validation (1,523) | 0.8424 | 0.8146 | 0.8196 | 0.8171 |
Training: 6,090 tweets (stratified 80/20 split of the Kaggle train set), 3 epochs, lr 2e-5, batch size 32, max length 128, linear schedule with 10% warmup.
Files
model.safetensors: PyTorch weights (stored in fp16), loadable withAutoModelForSequenceClassification.onnx/model.onnx: fp32 export; predictions identical to the PyTorch model on the validation set.onnx/model_quantized.onnx: per-channel dynamic int8 quantization; same validation accuracy (0.8424), but about 10% of individual predictions differ from the fp32 model.
Usage (transformers)
from transformers import pipeline
classifier = pipeline("text-classification", model="XiaoxiaoMa001/bert-disaster-tweets")
classifier("Forest fire near La Ronge Sask. Canada")
Usage (transformers.js)
import { pipeline } from "@huggingface/transformers";
const classifier = await pipeline("text-classification", "XiaoxiaoMa001/bert-disaster-tweets", { dtype: "fp32" });
await classifier("Forest fire near La Ronge Sask. Canada", { top_k: null });