Text Classification
Transformers
ONNX
Safetensors
English
bert
disaster-tweets
fine-tuned
text-embeddings-inference
Instructions to use CollinMa/disaster-tweets-bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CollinMa/disaster-tweets-bert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="CollinMa/disaster-tweets-bert")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("CollinMa/disaster-tweets-bert") model = AutoModelForSequenceClassification.from_pretrained("CollinMa/disaster-tweets-bert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from CollinMa/disaster-tweets-bert: direct link, hf CLI and curl.
- Browser
- Download file 2.11 kB
-
https://huggingface.co/CollinMa/disaster-tweets-bert/resolve/main/README.md
- Command line
-
hf download hf://CollinMa/disaster-tweets-bert/README.md
-
curl -L -o README.md https://huggingface.co/CollinMa/disaster-tweets-bert/resolve/main/README.md
2.11 kB
| language: en | |
| license: apache-2.0 | |
| library_name: transformers | |
| pipeline_tag: text-classification | |
| base_model: google-bert/bert-base-uncased | |
| datasets: | |
| - venetis/disaster_tweets | |
| tags: | |
| - bert | |
| - disaster-tweets | |
| - fine-tuned | |
| # BERT fine-tuned on Disaster Tweets | |
| Full-parameter fine-tuning of English BERT for binary disaster-tweet classification. | |
| Labels: `NOT_DISASTER` (0), `DISASTER` (1). This model classifies text and does not verify events. | |
| ## Held-out evaluation | |
| | Model | Accuracy | Precision | Recall | F1 | | |
| |---|---:|---:|---:|---:| | |
| | TF-IDF + Logistic Regression | 0.7864 | 0.8093 | 0.6520 | 0.7222 | | |
| | BERT full fine-tuning | 0.8238 | 0.8258 | 0.7429 | 0.7822 | | |
| 749 test examples; duplicate removal before a seeded, stratified 80/10/10 split. | |
| Best checkpoint selected using validation F1 only. No Kaggle leaderboard score is claimed. | |
| ## Training | |
| 3 epochs, learning rate 2e-05, | |
| batch size 8, gradient accumulation 2, | |
| max length 128, | |
| AdamW, dynamic padding, bf16. Seed 42. | |
| Base revision: `86b5e0934494bd15c9632b12f734a8a67f723594`. | |
| Dataset mirror revision: `896f918ab4d22b0ad24f8e2d01b84acf0742c050`. | |
| Original data source: https://www.kaggle.com/competitions/nlp-getting-started | |
| The source data's usage conditions continue to apply independently of this repository's model metadata. | |
| ## Inference | |
| ```python | |
| from transformers import pipeline | |
| classifier = pipeline("text-classification", model="CollinMa/disaster-tweets-bert") | |
| classifier("Residents are evacuating as a wildfire approaches.", truncation=True, max_length=128) | |
| ``` | |
| Scores are uncalibrated softmax outputs. English input only; inputs longer than 128 tokens are truncated. | |
| Full training summary: `training_summary.json`. | |
| ## Browser deployment | |
| ONNX model: `onnx/model_quantized.onnx`. 浏览器实际使用同一检查点的 INT8 ONNX 版本,大小 182.2 MB。该版本在同一独立测试集(batch=1)上 Accuracy=0.8238,Precision=0.8327,Recall=0.7335,F1=0.7800。这次评估用于记录量化对实际部署模型的影响,不再用于选择训练检查点。 | |