Model Card for Model ID
The language model classifies hail events from historical texts in standardised German.
Model Details
Model Description
This is a fine-tuned German BERT model that has been trained to classify text into three categories: H0, H1 and H2.
- H0: Passage without a hail event.
- H1: A passage describing hail without hail impact. The hailstones are smaller than 2 cm.
- H2: Passage describing hail impact or large accumulation. Hail impact begins at a size of 2 cm. Texts often contain size comparisons, such as hailstones the size of a cherry, walnut, pigeon or hen's egg. Damage descriptions also qualify, such as leaves, twigs or branches breaking off trees, dents or damage to fruit and vegetables, broken windowpanes or roofs, bark stripped from trees, broken roof tiles, damaged metal cladding and damaged window frames. Quantity descriptions, such as 'hail was knee-deep in the streets', also fall under this category.
Relative descriptions are also considered.
Training was performed using Hugging Face Transformers with mixed precision (fp16).
- Developed by: Franck Schätz
- Model type: Transformer-based sequence classifier
- Language(s) (NLP): German
- License: Apache-2.0
- Finetuned from model [optional]: microsoft/deberta-v3-base (bert-base-german-cased)
Model Sources [optional]
- Repository:
- Paper [optional]: Paper is in progress
Uses
Direct Use
- Classification and recognition of historical descriptions of hail events in German-speaking countries into three categories (H0, H1, H2).
- Recognition of hail-related events in texts on climate or environmental history.
Downstream Use [optional]
- Event extraction pipelines
- Historical climate reconstruction
- Pre-processing for environmental humanities research
Out-of-Scope Use
- Modern social media texts
- Creative writing or generative applications
- Semantic search without further adaptation
Bias, Risks, and Limitations
- The model reflects patterns in the historical corpus used for training.
- It may confuse similar weather phenomena such as heavy rain, sleet, or snowstorms.
- Spelling variants (especially pre-1900) can reduce accuracy.
Recommendations
- Manual validation is recommended for high-stakes research.
- Retraining is advised when applying the model to different eras or regions (e.g. after 1900 or mediterranean region ).
How to Get Started with the Model
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("your-username/hail-phaseB-bert")
model = AutoModelForSequenceClassification.from_pretrained("your-username/hail-phaseB-bert")
text = "Am 12. Juli 1845 fiel in der Gegend um Ulm ein heftiges Hagelwetter."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
label_id = outputs.logits.argmax(-1).item()
print("Hail" if label_id == 1 else "No hail")
Training Details
Training Data
- Manually annotated German historical weather descriptions
- Classes (3):
H0,H1,H2(see above)
Training Procedure
- Split: 80% train / 10% validation / 10% test
Preprocessing [optional]
Preprocessing is used to filter out events in the data that cannot be clearly classified. Events that cannot be classified, such as in the following quote: ‘In 1689, the cold autumn and late spring began, and with them the prolonged period of high prices, the harbingers of which were probably the severe hailstorms in 1686/1687,’ are classified as -99 in the data set. These are removed during preprocessing.
The original quote reads as follows: "Im Jahre 1689 fingen sich die kalte Herbst, und späte Frühling, und mit denselben die lang anhaltende Teuerung an, derer Vorboten vermutlich die starke Hagelwetter im Jahre 1686/1687 gewesen."
Training Hyperparameters
- Training regime: fp16
Speeds, Sizes, Times [optional]
| Parameter | Value |
|---|---|
| Learning rate | 3e-5 |
| Max length | 256 |
| Label smoothing | 0.05 |
| Scheduler | Cosine |
| Batch size | 16 |
| Epochs | 5 |
| Weight decay | 0.01 |
| Warmup ratio | 0.06 |
| Seed | 42 |
Evaluation
Testing Data, Factors & Metrics
Testing Data
[More Information Needed]
Factors
[More Information Needed]
Metrics
| Metric | Validation | Test |
|---|---|---|
| Accuracy | 0.956 | 0.964 |
| F1 (macro) | 0.910 | 0.933 ± 0.003 |
| F1 (weighted) | 0.956 | 0.956 |
| Loss | 0.33 | 0.29 |
Results
[More Information Needed]
Summary
Model Examination [optional]
[More Information Needed]
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware: NVIDIA GeForce RTX 3080 (12GB)
- Training time: ~1.8 hour per run
- Precision: fp16 mixed
- Region: EU
- Estimated emissions: < 1 kg CO₂e
Technical Specifications [optional]
Model Architecture and Objective
- Architecture: BERT (12 layers, 768 hidden size, 12 attention heads)
- Optimizer: AdamW
- Framework: Transformers 4.x, PyTorch 2.x
Compute Infrastructure
[More Information Needed]
Hardware
NVIDIA GeForce RTX 3080 (12GB)
Software
Only the most important Python libraries used for preprocessing and fine-tuning are listed.
Preprocessing: Pandas Finetuning: PyTorch, Transformers and Sklearn.Metrics
Citation [optional]
BibTeX:
@misc{hail_phaseB_2025,
title={Hail Classification – Phase B: Fine-Tuning a German BERT Model for Historical Climate Event Detection},
author={[Franck Schätz, Rüdiger Glaser]},
year={2025},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/your-username/hail-phaseB-bert}}
}
APA:
[More Information Needed]
Glossary [optional]
A quote is a text excerpt that contains all relevant information about a weather observation. According to Schätz (2023), this includes: – Event type (e.g. hail), – Time details (e.g. date or period), – Location or area (as geo-coordinates) and – Event severity. The latter is characterised in the form of a class. Possible classes are H0 (no hail), H1 (hail) and H2 (severe hail with hailstorm).
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
Franck Schätz ([email protected])
Model Card Contact
Franck Schätz ([email protected])
- Downloads last month
- 70
Model tree for Stickmu/HailBERT-de-v1
Base model
microsoft/deberta-v3-base