Massive multilingual translation
Speaking of cross-lingual models and models that can perform well on multilingual data, one of the tasks that are always important in this field is translation. However, different approaches exist for translation; some approaches suggest having different models for each language pair, whereas others suggest using a single model for all of the language pairs.
M2M100 is one of the most important models in this field and can translate 9,900 directions in 100 languages. Using this model and performing translation tasks is simple with the help of the transformers
library:
from transformers import ( M2M100ForConditionalGeneration, M2M100Tokenizer) model = M2M100ForConditionalGeneration.from_pretrained( "facebook/m2m100_1.2B") tokenizer = M2M100Tokenizer.from_pretrained( "facebook/m2m100_1.2B")
Before giving the input to the model, you need to also set the source...