Instructions to use google/bert2bert_L-24_wmt_en_de with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/bert2bert_L-24_wmt_en_de with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="google/bert2bert_L-24_wmt_en_de")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("google/bert2bert_L-24_wmt_en_de") model = AutoModelForSeq2SeqLM.from_pretrained("google/bert2bert_L-24_wmt_en_de") - Notebooks
- Google Colab
- Kaggle
Translates nonsense
The translator works well at the smallest setting.
"This is a blue car" -> "this is a blue car".
As soon as the sentences get a bit longer, the result has no relation to the source text.
Example Text: The fourth partial shutdown of the US government in a decade was four days away on Wednesday, with House Republicans preemptively rejecting a bipartisan bill.
...Is translated into this result:<s> Am 4. Januar 2005 wurde die Regierung von Präsident Bush von der US-Außenministerin Hillary Clinton und den Republikanern des Vereinigten Königreichs (Präsident George W. Bush ) abgelehnt. </s>
The result in English means On January 4, 2005, the administration of President Bush was rejected by the U.S. Secretary of State Hillary Clinton and the Republicans of the United Kingdom (President George W. Bush )
This result is nonsense and has no relation to the source text.
The right result would be this:
Input text [en] The fourth partial shutdown of the US government in a decade was four days away on Wednesday, with House Republicans preemptively rejecting a bipartisan bill.
Result [de] Der vierte partielle Stillstand der US-Regierung in einem Jahrzehnt war am Mittwoch vier Tage her, da die Republikaner im Repräsentantenhaus einen überparteilichen Gesetzentwurf vorsorglich ablehnten.