nlp_translation(self, *args, **kwargs) Method

Invoke the natural language translation interface and return the translation results
Request Syntax

nlp_translation_request = NlpTranslationRequest(fromLanguage="en", toLanguage="zh-chs",text="Hello World")
nlp_translation_result = vision_client.nlp_translation(nlp_translation_request)

Parameters

fromLanguage :String. Required. The code for the Source language that is to be translated. It now supports 7 languages, See below
. toLanguage :String. Required. The code for the Target language that is to be translated to. It now supports 7 languages. See below
. text :String. Required. Text to be translated.

List of Codes for the Supported Languages

Simplified Chinese English French German Spanish Japanese Korean Hindi
zh-chs en fr de es ja ko hi

Results Returned: NlpTranslationResult Type

Field Summary

Name Type Meaning
Engine String Use the name of the third party interface. Default is Microsoft.
Status Int Status Code. 0 means normal.
Result String Translation results

Example

{"engine": "AZURE", "status": 0, "result": "Hello World"}