8000 GitHub - schneipk/berts: DBMDZ BERT and ELECTRA models
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

schneipk/berts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

🤗 + 📚 dbmdz BERT models

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

Changelog

  • 16.11.2020: Public release of French Europeana BERT and ELECTRA models.
  • 15.11.2020: Public release of a German GPT-2 model.
  • 11.11.2020: Public release of Ukrainian ELECTRA model.
  • 02.11.2020: Public release of Italian XXL ELECTRA model.
  • 26.10.2020: In collaboration with Branden Chan and Timo Möller from deepset we've 8000 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.

The Italian ELECTRA model was trained on the "XXL" corpus for 1M steps in total using a batch size of 128. We pretty much following the ELECTRA training procedure as used for BERTurk.

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
dbmdz/electra-base-italian-xxl-cased-discriminator config.jsonpytorch_model.binvocab.txt
dbmdz/electra-base-italian-xxl-cased-generator 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 and ELECTRA

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 See model hub
dbmdz/bert-base-german-europeana-uncased See model hub
dbmdz/electra-base-german-europeana-cased-discriminator See model hub
dbmdz/electra-base-german-europeana-cased-generator See model hub

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")

French Europeana BERT and ELECTRA

We use the open source Europeana newspapers that were provided by The European Library. The final training corpus has a size of 63GB and consists of 11,052,528,456 tokens.

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

Model weights

Model Downloads
dbmdz/bert-base-french-europeana-cased See model hub
dbmdz/electra-base-french-europeana-cased-discriminator See model hub
dbmdz/electra-base-french-europeana-cased-generator See model hub

Usage

With Transformers >= 2.3 our French Europeana BERT and ELECTRA models can be loaded like:

from transformers import AutoModel, AutoTokenizer

model_name = "dbmdz/bert-base-french-europeana-cased"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

The ELECTRA (discriminator) model can be used with:

from transformers import AutoModel, AutoTokenizer

model_name = "dbmdz/electra-base-french-europeana-cased-discriminator"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

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")

Ukrainian ELECTRA

The source data for the Ukrainian ELECTRA model consists of two corpora:

  • Recent Wikipedia dump
  • Deduplicated Ukrainian part from the OSCAR corpus

The final training corpus has a size of 30GB and consits of exactly 2,402,761,324 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/electra-base-ukrainian-cased-discriminator See model hub
dbmdz/electra-base-ukrainian-cased-generator See model hub

Results

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

Usage

With Transformers >= 2.3 our Ukrainian ELECTRA model can be loaded like:

from transformers import AutoModel, AutoTokenizer

model_name = "dbmdz/electra-base-ukrainian-cased-discriminator"

tokenizer = AutoTokenizer.from_pretrained(model_name)

model = AutoModelWithLMHead.from_pretrained(model_name)

German GPT-2 model

The German GPT-2 model is meant to be an entry point for fine-tuning on other texts, and it is definitely not as good or "dangerous" as the English GPT-3 model.

For training we use pretty much the same corpora as used for training the DBMDZ BERT model. We created a 52K byte-level BPE vocab based on the training corpora.

The model was trained on one TPU over the whole training corpus for three epochs.

Detailed information can be found in this repository.

Model weights

In addition to the German GPT-2 model, we release a GPT-2 model, that was fine-tuned on a normalized version of Faust I and II.

Model Downloads
dbmdz/german-gpt2 See model hub
dbmdz/german-gpt2-faust See model hub

Usage

With Transformers >= 2.3 our German GPT-2 model can be used for text generation:

from transformers import pipeline

pipe = pipeline('text-generation', model="dbmdz/german-gpt2",
                 tokenizer="dbmdz/german-gpt2", config={'max_length':800})

text = pipe2("Der Sinn des Lebens ist es")[0]["generated_text"]

print(text)

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 🤗

About

DBMDZ BERT and ELECTRA models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0