Use NLLB Machine Translation with Pytorch

Viewed 21

I've managed to save a model for automatic translation with pytorch and I'm wondering how can I use it to translate input sentences.

I came across an article suggesting to use a class_mapping so I guess that I should use the dictionary available on that github page as python list https://github.com/facebookresearch/fairseq/tree/nllb

enter image description here

I used this line of code to load the model :

model = torch.load(PATH)
model.eval()

So my question is how can I use the model and the dictionary in order to "predict" the translation of a sentence ?

Thank you

0 Answers
Related