The Wayback Machine - https://web.archive.org/web/20201029005743/https://github.com/dbmdz/berts
Skip to content
main
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

🤗 + 📚 dbmdz BERT models

In this repository the MDZ Digital Library team (dbmdz) at the Bavarian State Library open sources another BERT models 🎉

Changelog

  • 26.10.2020: In collaboration with Branden Chan and Timo Möller from deepset we've trained larger language models for German. See our paper for more information!
  • 12.05.2020: Public release of small and base ELECTRA models for Turkish
  • 25.03.2020: Public release of BERTurk uncased model and BERTurk models with larger vocab size (128k, cased and uncased)
  • 11.03.2020: Public release of cased distilled BERT model for Turkish: DistilBERTurk
  • 17.02.2020: Public release of cased BERT model for Turkish: BERTurk
  • 10.02.2020: Public release of cased and uncased BERT models for Historic German: German Europeana BERT
  • 20.01.2019: Public release of cased and uncased XXL BERT models for Italian. They can be downloaded from the Huggingface model hub.
  • 30.12.2019: Public release of cased and uncased BERT models for Italian.
  • 08.12.2019: If you consider using our model for the upcoming GermEval 2020 shared task, please read at least this blog post by Emily Bender on ethical issues!
  • 10.10.2019: Public release
  • 24.09.2019: Initial version

German BERT

Stats

In addition to the recently released German BERT model by deepset we provide another German-language model.

The source data for the model consists of a recent Wikipedia dump, EU Bookshop corpus, Open Subtitles, CommonCrawl, ParaCrawl and News Crawl. This results in a dataset with a size of 16GB and 2,350,234,427 tokens.

For sentence splitting, we use spacy. Our preprocessing steps (sentence piece model for vocab generation) follow those used for training SciBERT. The model is trained with an initial sequence length of 512 subwords and was performed for 1.5M steps.

This release includes both cased and uncased models.

Model weights

Currently only PyTorch-Transformers compatible weights are available. If you need access to TensorFlow checkpoints, please raise an issue!

Model Downloads
bert-base-german-dbmdz-cased config.jsonpytorch_model.binvocab.txt
bert-base-german-dbmdz-uncased config.jsonpytorch_model.binvocab.txt

Usage

With Transformers >= 2.3 our German BERT models can be loaded like:

from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-german-cased")
model = AutoModel.from_pretrained("dbmdz/bert-base-german-cased")

Results

For results on downstream tasks like NER or PoS tagging, please refer to this repository.

Italian BERT

The source data for the Italian BERT model consists of a recent Wikipedia dump and various texts from the OPUS corpora collection. The final training corpus has a size of 13GB and 2,050,057,573 tokens.

For sentence splitting, we use NLTK (faster compared to spacy). Our cased and uncased models are training with an initial sequence length of 512 subwords for ~2-3M steps.

For the XXL Italian models, we use the same training data from OPUS and extend it with data from the Italian part of the OSCAR corpus. Thus, the final training corpus has a size of 81GB and 13,138,379,147 tokens.

Note: Unfortunately, a wrong vocab size was used when training the XXL models. This explains the mismatch of the "real" vocab size of 31102, compared to the vocab size specified in config.json. However, the model is working and all evaluations were done under those circumstances. See this issue for more information.

Model weights

Currently only PyTorch-Transformers compatible weights are available. If you need access to TensorFlow checkpoints, please raise an issue!

Model Downloads
dbmdz/bert-base-italian-cased config.jsonpytorch_model.binvocab.txt
dbmdz/bert-base-italian-uncased config.jsonpytorch_model.binvocab.txt
dbmdz/bert-base-italian-xxl-cased config.jsonpytorch_model.binvocab.txt
dbmdz/bert-base-italian-xxl-uncased config.jsonpytorch_model.binvocab.txt

Results

For results on downstream tasks like NER or PoS tagging, please refer to this repository.

Usage

With Transformers >= 2.3 our Italian BERT models can be loaded like:

from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-italian-cased")
model = AutoModel.from_pretrained("dbmdz/bert-base-italian-cased")

To load the (recommended) Italian XXL BERT models, just use:

from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-italian-xxl-cased")
model = AutoModel.from_pretrained("dbmdz/bert-base-italian-xxl-cased")

German Europeana BERT

We use the open source Europeana newspapers that were provided by The European Library. The final training corpus has a size of 51GB and consists of 8,035,986,369 tokens.

Detailed information about the data and pretraining steps can be found in this repository.

Model weights

Currently only PyTorch-Transformers compatible weights are available. If you need access to TensorFlow checkpoints, please raise an issue!

Model Downloads
dbmdz/bert-base-german-europeana-cased config.jsonpytorch_model.binvocab.txt
dbmdz/bert-base-german-europeana-uncased config.jsonpytorch_model.binvocab.txt

Results

For results on Historic NER, please refer to this repository.

Usage

With Transformers >= 2.3 our German Europeana BERT models can be loaded like:

from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-german-europeana-cased")
model = AutoModel.from_pretrained("dbmdz/bert-base-german-europeana-cased")

The German Europeana BERT uncased model can be loaded like:

from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-german-europeana-uncased")
model = AutoModel.from_pretrained("dbmdz/bert-base-german-europeana-uncased")

Turkish BERT: BERTurk, DistilBERTurk and ELECTRA

BERTurk are community-driven cased models for Turkish.

Some datasets used for pretraining and evaluation are contributed from the awesome Turkish NLP community, as well as the decision for the BERT model name: BERTurk.

The final training corpus has a size of 35GB and 44,04,976,662 tokens.

Detailed information about the data and pretraining steps can be found in this repository.

Additionally, we trained a distilled version of BERTurk: DistilBERTurk, that uses knowledge-distillation from BERTurk (teacher model). More information on distillation can be found in the excellent "DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter" paper by Sanh et al. (2019).

Furthermore, we provide cased and uncased models trained with a larger vocab size (128k instead of 32k).

We also trained small and base ELECTRA models. ELECTRA is a new method for self-supervised language representation learning. More details about ELECTRA can be found in the ICLR paper.

Evaluation of our ELECTRA models can be found in this repository.

Model weights

Transformers compatible weights are available. If you need access to TensorFlow checkpoints, please raise an issue!

Model Downloads
dbmdz/bert-base-turkish-cased config.jsonpytorch_model.binvocab.txt
dbmdz/bert-base-turkish-uncased config.jsonpytorch_model.binvocab.txt
dbmdz/bert-base-turkish-128k-cased config.jsonpytorch_model.binvocab.txt
dbmdz/bert-base-turkish-128k-uncased config.jsonpytorch_model.binvocab.txt
dbmdz/distilbert-base-turkish-cased config.jsonpytorch_model.binvocab.txt
dbmdz/electra-small-turkish-cased-discriminator config.jsonpytorch_model.binvocab.txt
dbmdz/electra-base-turkish-cased-discriminator config.jsonpytorch_model.binvocab.txt

Results

For results on PoS tagging or NER tasks, please refer to this repository.

Usage

With Transformers >= 2.3 our BERTurk cased model can be loaded like:

from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-turkish-cased")
model = AutoModel.from_pretrained("dbmdz/bert-base-turkish-cased")

The DistilBERTurk model can be loaded with:

from transformers import AutoModel, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/distilbert-base-turkish-cased")
model = AutoModel.from_pretrained("dbmdz/distilbert-base-turkish-cased")

Our ELECTRA models can be used with Transformers >= 2.8 and can be loaded with:

from transformers import AutoModelWithLMHead, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("dbmdz/electra-base-turkish-cased-discriminator")
model = AutoModelWithLMHead.from_pretrained("dbmdz/electra-base-turkish-cased-discriminator")

License

All models are licensed under MIT.

Huggingface model hub

All models are available on the Huggingface model hub.

Papers

Here you can find a list papers, that used one of our trained models. Feel free to open a PR/issue if you want your paper to be included!

Contact (Bugs, Feedback, Contribution and more)

For questions about our BERT models just open an issue here 🤗

Acknowledgments

Research supported with Cloud TPUs from Google's TensorFlow Research Cloud (TFRC). Thanks for providing access to the TFRC ❤️

Thanks to the generous support from the Hugging Face team, it is possible to download both cased and uncased models from their S3 storage 🤗

You can’t perform that action at this time.