Downloads · 30 days
780
0% of all-time downloads
google/bert2bert_L-24_wmt_de_en
bert2bert_L-24_wmt_de_en is a translation model from google. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as apache-2.0.
The model was introduced in this paper by Sascha Rothe, Shashi Narayan, Aliaksei Severyn and first released in this repository.
Downloads · 30 days
780
0% of all-time downloads
All-time downloads
380K
Public
Repo size
6.2 GB
Likes
8
Public
Click a slice to open those files.
.bin3.1 GB · 100%
From the Hugging Face model README
The model was introduced in this paper by Sascha Rothe, Shashi Narayan, Aliaksei Severyn and first released in this repository.
The model is an encoder-decoder model that was initialized on the bert-large checkpoints for both the encoder
and decoder and fine-tuned on German to English translation on the WMT dataset, which is linked above.
Disclaimer: The model card has been written by the Hugging Face team.
You can use this model for translation, e.g.
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("google/bert2bert_L-24_wmt_de_en", pad_token="<pad>", eos_token="</s>", bos_token="<s>")
model = AutoModelForSeq2SeqLM.from_pretrained("google/bert2bert_L-24_wmt_de_en")
sentence = "Willst du einen Kaffee trinken gehen mit mir?"
input_ids = tokenizer(sentence, return_tensors="pt", add_special_tokens=False).input_ids
output_ids = model.generate(input_ids)[0]
print(tokenizer.decode(output_ids, skip_special_tokens=True))
# should output
# Want to drink a kaffee go with me? .