---
title: bert2bert_L-24_wmt_de_en
canonical_url: "https://www.modelscope.cn/models/google/bert2bert_L-24_wmt_de_en"
md_url: "https://www.modelscope.cn/models/google/bert2bert_L-24_wmt_de_en.md"
repository: google/bert2bert_L-24_wmt_de_en
last_updated: 2025-04-21
license: apache-2.0
pipeline_tag: translation
tasks:
  - translation
model_type:
  - encoder-decoder
architectures:
  - EncoderDecoderModel
library_name:
  - transformer
  - pytorch
frameworks:
  - pytorch
language:
  - en
  - de
downloads: 421
stars: 0
tags:
  - translation
---

# bert2bert_L-24_wmt_de_en

> bert2bert_L-24_wmt_de_en - google 在 ModelScope 开源的模型。bert2bertL-24wmtdeen EncoderDecoder model

google/bert2bert_L-24_wmt_de_en 是 ModelScope 魔搭社区上的translation模型，采用 apache-2.0 许可。

- **Repository**: google/bert2bert_L-24_wmt_de_en
- **License**: apache-2.0
- **Tasks**: translation
- **Tags**: translation
- **Downloads**: 421
- **Stars**: 0
- **Last updated**: 2025-04-21

Source: https://www.modelscope.cn/models/google/bert2bert_L-24_wmt_de_en

---

# bert2bert_L-24_wmt_de_en EncoderDecoder model

The model was introduced in 
[this paper](https://arxiv.org/abs/1907.12461) by Sascha Rothe, Shashi Narayan, Aliaksei Severyn and first released in [this repository](https://tfhub.dev/google/bertseq2seq/bert24_de_en/1). 

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.

## How to use

You can use this model for translation, *e.g.*

```python
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? .
```
