1. 程式人生 > >Lingual Bot on the Oracle Chatbot Platform

Lingual Bot on the Oracle Chatbot Platform

Copy the API key from the Google Console that we created earlier and use it for the Authorization Token.

Open your Bot, and define the below context variables in your dialog flow:

autoTranslate: “boolean”
 translated: “string”

Create the below states with the language specific components for the translation service to be detected automatically:

setAutoTranslate:
 component: “System.SetVariable”
 properties:
 variable: “autoTranslate”
 value: true
 transitions: {}
 detect:
 component: “System.DetectLanguage”
 properties: {}
 transitions: {}
 translate:
 component: “System.TranslateInput”
 properties:
 variable: “translated”
 transitions: {}

Add the source variable in the Intent flow that holds the English Translation of the user input :

intent:
 component: “System.Intent”
 properties:
 variable: “iResult”
 sourceVariable: “translated” 
 confidenceThreshold: 0.4

That’s is all we need for auto-translation. You can test your Bot in the simulator and you should start seeing the conversation shaping based on the user’s language input.

Few Examples :

English (default) and Bot response

Spanish Detection :

User asking for the same thing in Spanish and Bot responding in English
Hindi Input and Bot responding back in Hindi

In the next Post, I will talk about how we can override some of the Bot responses using the Language Bundle Packs bundled with the platform if Google/ Bing Translation outputs doesn’t fit the customer’s requirements.