Language translation
In this recipe, we will use transformers for language translation. We will use the Google Text-To-Text Transfer Transformer (T5) model. This model is an end-to-end model that uses both the encoder and decoder components of the transformer model.
Getting ready
As part of this recipe, we will use the pipeline module from the transformers package. You can use the 8.6_Language_Translation_with_transformers.ipynb
notebook from the code site if you need to work from an existing notebook.
How to do it...
In this recipe, you will initialize a seed sentence in English and translate it to French. The T5 model expects the input format to encode the information about the language translation task along with the seed sentence. In this case, the encoder uses the input in the source language and generates a representation of the text. The decoder uses this representation and generates text for the target language. The T5 model is trained specifically for this task...