Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,109 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- de
|
5 |
+
tags:
|
6 |
+
- RoBERTa
|
7 |
+
- GottBERT
|
8 |
+
- BERT
|
9 |
+
---
|
10 |
+
# GottBERT: A pure German language model
|
11 |
+
|
12 |
+
GottBERT is the first German-only RoBERTa model, pre-trained on the German portion of the first released OSCAR dataset. This model aims to provide enhanced natural language processing (NLP) performance for the German language across various tasks, including Named Entity Recognition (NER), text classification, and natural language inference (NLI). GottBERT has been developed in two versions: a **base model** and a **large model**, tailored specifically for German-language tasks.
|
13 |
+
|
14 |
+
- **Model Type**: RoBERTa
|
15 |
+
- **Language**: German
|
16 |
+
- **Base Model**: 12 layers, 125 million parameters
|
17 |
+
- **Large Model**: 24 layers, 355 million parameters
|
18 |
+
- **License**: MIT
|
19 |
+
|
20 |
+
---
|
21 |
+
|
22 |
+
## Pretraining Details
|
23 |
+
|
24 |
+
- **Corpus**: German portion of the OSCAR dataset (Common Crawl).
|
25 |
+
- **Data Size**:
|
26 |
+
- Unfiltered: 145GB (~459 million documents)
|
27 |
+
- Filtered: 121GB (~382 million documents)
|
28 |
+
- **Preprocessing**: Filtering included correcting encoding errors (e.g., erroneous umlauts), removing spam and non-German documents using language detection and syntactic filtering.
|
29 |
+
|
30 |
+
### Filtering Metrics
|
31 |
+
- **Stopword Ratio**: Detects spam and meaningless content.
|
32 |
+
- **Punctuation Ratio**: Detects abnormal punctuation patterns.
|
33 |
+
- **Upper Token Ratio**: Identifies documents with excessive uppercase tokens (often noisy content).
|
34 |
+
|
35 |
+
## **Training Configuration**
|
36 |
+
- **Framework**: [Fairseq](https://github.com/scheiblr/fairseq/tree/TPUv4_very_old)
|
37 |
+
- **Hardware**:
|
38 |
+
- Base Model: 256 TPUv3 pod/128 TPUv4 pod
|
39 |
+
- Large Model: 128 TPUv4 pod
|
40 |
+
- **Training Time**:
|
41 |
+
- Base Model: 1.2 days
|
42 |
+
- Large Model: 5.7 days
|
43 |
+
- **Batch Size**: 8k tokens
|
44 |
+
- **Learning Rate**:
|
45 |
+
- Base: Peak LR = 0.0004
|
46 |
+
- Large: Peak LR = 0.00015
|
47 |
+
- **Training Iterations**: 100k steps with a 10k warm-up phase
|
48 |
+
|
49 |
+
## Evaluation and Results
|
50 |
+
GottBERT was evaluated across various downstream tasks:
|
51 |
+
- **NER**: CoNLL 2003, GermEval 2014
|
52 |
+
- **Text Classification**: GermEval 2018 (coarse & fine), 10kGNAD
|
53 |
+
- **NLI**: German subset of XNLI
|
54 |
+
|
55 |
+
Mertics:
|
56 |
+
- **NER and Text Classification**: F1 Score
|
57 |
+
- **NLI**: Accuracy
|
58 |
+
|
59 |
+
|
60 |
+
Details:
|
61 |
+
- **bold** values indicate the best performing model within one architecure (base, large), <ins>undescored</ins> values the second best.
|
62 |
+
|
63 |
+
|
64 |
+
| Model | Accuracy NLI | GermEval\_14 F1 | CoNLL F1 | Coarse F1 | Fine F1 | 10kGNAD F1 |
|
65 |
+
|-------------------------------------|--------------|----------------|----------|-----------|---------|------------|
|
66 |
+
| [GottBERT_base_best](https://huggingface.co/TUM/GottBERT_base_best) | 80.82 | 87.55 | <ins>85.93</ins> | 78.17 | 53.30 | 89.64 |
|
67 |
+
| [GottBERT_base_last](https://huggingface.co/TUM/GottBERT_base_last) | 81.04 | 87.48 | 85.61 | <ins>78.18</ins> | **53.92** | 90.27 |
|
68 |
+
| [GottBERT_filtered_base_best](https://huggingface.co/TUM/GottBERT_filtered_base_best) | 80.56 | <ins>87.57</ins> | **86.14** | **78.65** | 52.82 | 89.79 |
|
69 |
+
| [GottBERT_filtered_base_last](https://huggingface.co/TUM/GottBERT_filtered_base_last) | 80.74 | **87.59** | 85.66 | 78.08 | 52.39 | 89.92 |
|
70 |
+
| GELECTRA_base | **81.70** | 86.91 | 85.37 | 77.26 | 50.07 | 89.02 |
|
71 |
+
| GBERT_base | 80.06 | 87.24 | 85.16 | 77.37 | 51.51 | **90.30** |
|
72 |
+
| dbmdzBERT | 68.12 | 86.82 | 85.15 | 77.46 | 52.07 | **90.34** |
|
73 |
+
| GermanBERT | 78.16 | 86.53 | 83.87 | 74.81 | 47.78 | 90.18 |
|
74 |
+
| XLM-R_base | 79.76 | 86.14 | 84.46 | 77.13 | 50.54 | 89.81 |
|
75 |
+
| mBERT | 77.03 | 86.67 | 83.18 | 73.54 | 48.32 | 88.90 |
|
76 |
+
| [GottBERT_large](https://huggingface.co/TUM/GottBERT_large) | 82.46 | 88.20 | <ins>86.78</ins> | 79.40 | 54.61 | 90.24 |
|
77 |
+
| [GottBERT_filtered_large_best](https://huggingface.co/TUM/GottBERT_filtered_large_best) | 83.31 | 88.13 | 86.30 | 79.32 | 54.70 | 90.31 |
|
78 |
+
| [GottBERT_filtered_large_last](https://huggingface.co/TUM/GottBERT_filtered_large_last) | 82.79 | <ins>88.27</ins> | 86.28 | 78.96 | 54.72 | 90.17 |
|
79 |
+
| GELECTRA_large | **86.33** | <ins>88.72</ins> | <ins>86.78</ins> | **81.28** | <ins>56.17</ins> | **90.97** |
|
80 |
+
| GBERT_large | <ins>84.21</ins> | <ins>88.72</ins> | **87.19** | <ins>80.84</ins> | **57.37** | <ins>90.74</ins> |
|
81 |
+
| XLM-R_large | 84.07 | **88.83** | 86.54 | 79.05 | 55.06 | 90.17 |
|
82 |
+
|
83 |
+
|
84 |
+
## Model Architecture
|
85 |
+
- **Base Model**: 12 layers, 125M parameters, 52k token vocabulary.
|
86 |
+
- **Large Model**: 24 layers, 355M parameters, 52k token vocabulary.
|
87 |
+
|
88 |
+
### Tokenizer
|
89 |
+
- **Type**: GPT-2 Byte-Pair Encoding (BPE)
|
90 |
+
- **Vocabulary Size**: 52k subword tokens
|
91 |
+
- **Trained on**: 40GB subsample of the unfiltered German OSCAR corpus.
|
92 |
+
|
93 |
+
## Limitations
|
94 |
+
- **Filtered vs Unfiltered Data**: Minor improvements seen with filtered data, but not significant enough to justify filtering in every case.
|
95 |
+
- **Computation Limitations**: Fixed memory allocation on TPUs required processing data as a single stream, unlike GPU training which preserves document boundaries. Training was performed in 32-bit mode due to framework limitations, increasing memory usage.
|
96 |
+
|
97 |
+
## Citations
|
98 |
+
If you use GottBERT in your research, please cite the following paper:
|
99 |
+
```bibtex
|
100 |
+
@misc{scheible2020gottbertpuregermanlanguage,
|
101 |
+
title={GottBERT: a pure German Language Model},
|
102 |
+
author={Raphael Scheible and Fabian Thomczyk and Patric Tippmann and Victor Jaravine and Martin Boeker},
|
103 |
+
year={2020},
|
104 |
+
eprint={2012.02110},
|
105 |
+
archivePrefix={arXiv},
|
106 |
+
primaryClass={cs.CL},
|
107 |
+
url={https://arxiv.org/abs/2012.02110},
|
108 |
+
}
|
109 |
+
```
|