Downloads · 30 days
6
12% of all-time downloads
hakansabunis/turkish-flood-news-bert
turkish-flood-news-bert is a text classification model from hakansabunis. Use it when you need a label for a piece of text. The card lists the license as mit.
Binary classifier that decides whether a Turkish news article is reporting an actual flood event in Turkey (1) or not (0). Fine-tuned from dbmdz/bert-base-turkish-cased on a small curated corpus of Turkish flood news…
Downloads · 30 days
6
12% of all-time downloads
All-time downloads
51
Public
Parameters
111M
442 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors442 MB · 100%
From the Hugging Face model README
Binary classifier that decides whether a Turkish news article is reporting an actual flood event in Turkey (1) or not (0). Fine-tuned from dbmdz/bert-base-turkish-cased on a small curated corpus of Turkish flood news articles.
⚠️ This is a Phase 1 model — narrow, binary, trained on a modest dataset. A multi-class disaster classifier covering 7 disaster types (flood, earthquake, fire, landslide, avalanche, storm, sandstorm) is in development. See Roadmap.
from transformers import BertTokenizer, BertForSequenceClassification
import torch
tokenizer = BertTokenizer.from_pretrained("hakansabunis/turkish-flood-news-bert")
model = BertForSequenceClassification.from_pretrained("hakansabunis/turkish-flood-news-bert")
model.eval()
text = "Rize Çamlıhemşin'de aşırı yağış sonucu dere taştı, üç ev yıkıldı."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
logits = model(**inputs).logits
pred = int(torch.argmax(logits, dim=-1).item())
prob = torch.softmax(logits, dim=-1)[0, 1].item()
print(f"Flood event? {'YES' if pred == 1 else 'NO'} (P(flood)={prob:.3f})")
Or with a pipeline:
from transformers import pipeline
clf = pipeline("text-classification", model="hakansabunis/turkish-flood-news-bert")
clf("Rize'de dere taştı, mahalle sular altında kaldı.")
A curated Turkish flood-news corpus assembled from:
| Split | Total | Negative (0) | Positive (1) |
|---|---|---|---|
| Train | 574 | 296 | 278 |
| Validation | 71 | 38 | 33 |
| Test | 71 | 24 | 47 |
| Total | 716 | 358 | 358 |
Negative examples were curated to include adversarial cases:
| Hyperparameter | Value |
|---|---|
| Base model | dbmdz/bert-base-turkish-cased (110M params) |
| Epochs | 4 (with early stopping, patience=2) |
| Batch size | 16 |
| Learning rate | 2e-5 |
| Optimizer | AdamW |
| Warmup ratio | 0.1 |
| Weight decay | 0.01 |
| Max sequence length | 512 |
| Mixed precision | FP16 (GPU) |
| Best-model selection | by validation F1 |
Training was performed on a single NVIDIA RTX 3050 Laptop GPU (4GB VRAM) under WSL2.
Reported on the held-out test set (n=71):
| Metric | Value |
|---|---|
| Accuracy | ~1.00 |
| F1 (macro) | ~1.00 |
| Precision | ~1.00 |
| Recall | ~1.00 |
Honest caveat: the test set is small (71 examples). The high F1 reflects strong in-distribution performance but does not guarantee the model is robust to:
A larger, time-stratified evaluation is planned with the multi-label v2 model.
sel), earthquake (deprem), fire (yangin), landslide (heyelan), avalanche (cig), storm (firtina), sandstorm (kum_firtinasi).If you use this model in academic work, please cite the base model and link this repository:
@misc{schweter2020berturk,
author = {Stefan Schweter},
title = {BERTurk - BERT models for Turkish},
year = {2020},
publisher = {Zenodo},
doi = {10.5281/zenodo.3770924},
url = {https://doi.org/10.5281/zenodo.3770924}
}
@misc{sabunis2025floodbert,
author = {Hakan Sabunis},
title = {Turkish Flood News Classifier (BERTurk fine-tune)},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/hakansabunis/turkish-flood-news-bert}
}
Built as part of an undergraduate capstone project at İstanbul Medipol University — the broader FloodGuard disaster early-warning system.
MIT — see LICENSE. The base model (dbmdz/bert-base-turkish-cased) is licensed under MIT.
Bir Türkçe haber metninin Türkiye'de gerçekleşmiş bir sel olayını raporlayıp raporlamadığını ikili (1 / 0) olarak sınıflandırır. dbmdz/bert-base-turkish-cased baz alınarak fine-tune edilmiştir.
⚠️ Bu Faz 1 modeldir — dar kapsamlı, ikili, mütevazı bir veri setiyle eğitilmiş. 7 afet tipi içeren çok-etiketli bir sürüm geliştirilmektedir.
| Bölüm | Toplam | Negatif | Pozitif |
|---|---|---|---|
| Eğitim | 574 | 296 | 278 |
| Doğrulama | 71 | 38 | 33 |
| Test | 71 | 24 | 47 |
Negatif örnekler bilinçli olarak kafa karıştırıcı vakalardan derlendi: mecazi kullanımlar ("gözyaşları sel"), yurt dışı olayları, uyarılar/tahminler, geçmiş yıl anmaları.
4 epoch, batch=16, lr=2e-5, AdamW, warmup=0.1, weight decay=0.01, FP16, max_len=512. Best-F1 model seçimi + early stopping. RTX 3050 4GB VRAM (WSL2) üzerinde eğitildi.
n=71 — F1 ≈ 1.00. Dürüst not: Test seti küçük; in-distribution performansı iyi olsa da gerçek dünya dağılım kayması, mecazi yeni kalıplar veya çok-tipli haberler için sonuç bu kadar yüksek olmayacaktır.
Akademik çalışmada kullanılırsa lütfen yukarıdaki BibTeX'i kullanın.
İstanbul Medipol Üniversitesi capstone projesi (FloodGuard erken uyarı sistemi) — Hakan Sabunis, [email protected]