rust-bert icon indicating copy to clipboard operation
rust-bert copied to clipboard

Translation API should allow for multiple source/target languages

Open mrjackbo opened this issue 2 years ago • 1 comments

Hi, thanks so much for the great project!

At the moment TranslationModel::translate takes a slice of texts to translate, a source language and a destination language and produces a slice of translated texts.

For models like m2m or nnlb, it would be convenient if there were an additional method, perhaps translate_multi_lang, that takes a slice of texts to translate, a slice of source languages and possibly a slice of destination languages. This way one could make use of the batched inference but for multiple source/destination pairs.

At least for multiple source languages, this would be very easy to implement.

mrjackbo avatar Jun 13 '23 22:06 mrjackbo

Hello @mrjackbo ,

Apologies for getting back to you with a delay. This may indeed be useful - would you like to draft a pull request? If not I will try to have a look at it this week-end.

guillaume-be avatar Jul 11 '23 17:07 guillaume-be