riva/proto/riva_nmt.proto#

service RivaTranslation#

RivaTranslation service provides rpcs to translate between languages.

rpc TranslateTextResponse TranslateText(TranslateTextRequest)

Translate text to text, from a source to a target language. Currently source and target language fields is required, along with the model name. Multiple texts may be passed per request up to the given batch size for the model, which is set at translation pipeline creation time.

rpc AvailableLanguageResponse ListSupportedLanguagePairs(AvailableLanguageRequest)

Lists the available language pairs and models names to be used for TranslateText

message AvailableLanguageRequest#

Returns a map of model names to its source and target language pairs. Can specificy a specific model name to retrieve only its language pairs.

string model#

If empty returns all available languages.

message AvailableLanguageResponse#

Language pairs are the sets of src to tgt languages available per model. languages contains all the model_name -> Language pair

AvailableLanguageResponse.LanguagesEntry languages (repeated)
message AvailableLanguageResponse.LanguagePair
string src_lang(repeated)#
string tgt_lang(repeated)#
message AvailableLanguageResponse.LanguagesEntry
string key
AvailableLanguageResponse.LanguagePair value
message TranslateTextRequest#

request for synchronous translation of each text in texts. Available languages can be queried using ListSupportLanguagePairs RPC. source and target languages must be specified, are currently two character ISO codes, this will likely change to BCP-47 inline with other Riva Services for GA.

string texts(repeated)#
string model#
string source_language#
string target_language#
message TranslateTextResponse#

Translations are returned as text:language pairs. These are 1:1 for the passed in ‘texts’ from the request.

Translation translations(repeated)#
message Translation#

contains a single translation, collecting into the translate text response Includes the target language code, since with multi lingual models there are multiple possibilities.

string text#
string language#