In this repository we open source a language model for Historic Dutch, trained on the Delpher Corpus, that include digitized texts from Dutch newspapers, ranging from 1618 to 1879.
- 13.12.2021: Initial version of this repository.
The following models for Historic Dutch are available on the Hugging Face Model Hub:
|Model identifier||Model Hub link|
The download urls for all archives can be found here.
We then used the awesome
alto-tools from this
repository to extract plain text. The following table shows the size overview per year range:
|Period||Extracted plain text size|
The total training corpus consists of 427,181,269 sentences and 3,509,581,683 tokens (counted via
resulting in a total corpus size of 21GB.
The following figure shows an overview of the number of chars per year distribution:
We use the official BERT implementation using the following command to train the model:
python3 run_pretraining.py --input_file gs://delpher-bert/tfrecords/*.tfrecord \ --output_dir gs://delpher-bert/bert-base-historic-dutch-cased \ --bert_config_file ./config.json \ --max_seq_length=512 \ --max_predictions_per_seq=75 \ --do_train=True \ --train_batch_size=128 \ --num_train_steps=3000000 \ --learning_rate=1e-4 \ --save_checkpoints_steps=100000 \ --keep_checkpoint_max=20 \ --use_tpu=True \ --tpu_name=electra-2 \ --num_tpu_cores=32
We train the model for 3M steps using a total batch size of 128 on a v3-32 TPU. The pretraining loss curve can be seen in the next figure:
We evaluate our model on the preprocessed Europeana NER dataset for Dutch, that was presented in the "Data Centric Domain Adaptation for Historical Text with OCR Errors" paper.
The data is available in their repository. We perform a hyper-parameter search for:
- Batch sizes:
- Learning rates:
- Number of epochs:
and report averaged F1-Score over 5 runs with different seeds. We also include hmBERT as baseline model.
|Model||F1-Score (Dev / Test)|
|hmBERT||(82.73) / 81.34|
|Maerz et al. (2021)||- / 84.2|
|Ours||(89.73) / 87.45|
All models are licensed under MIT.
Research supported with Cloud TPUs from Google's TPU Research Cloud (TRC) program, previously known as TensorFlow Research Cloud (TFRC). Many thanks for providing access to the TRC ❤️
Thanks to the generous support from the Hugging Face team, it is possible to download both cased and uncased models from their S3 storage 🤗
- Downloads last month