I have built a Q&A-chatbot using Amazon Lex with all intents and its utterances being in English. Now of course when an user asks some question in English, Amazon Lex processes the question and gives an answer in English. Now I also want to make it possible for example using Amazon Translate to have a possibility for other language interactions. That means: e.g. French user asks a question in French, Amazon Translate translates it into English and automatically forwards it to Amazon Lex, where the procedure just continues as before. The answers, which are triggered by the lambda function, are in English so when answering Amazon Translate should take the English answer text, translate it back into French and return it to the user.
Is there a proper tutorial on that as the Tutorials by Amazon seem to be just general information. Or is there a simple button I can click on and Amazon Translate is already ready to go ;)
Thanks for your answers in advance!
Using the AWS SDK, you can build this functionality. You can use Amazon Comprehend to determine the language. If it's french (or other supported language), pass the string to the AWS Translate service to get English.
This is a multi service use case that requires code. I programmed an example web app by using the AWS SDK For Java that performs this use case perfectly.
This Java code uses Amazon LEX, Comprehend, and the AWS Translation to solve this use case. As you can see, this handles French and other languages.
This example handles other languages too such as Italian:
Here is the Java V2 code that solves this. Note that the text is posted from the HTML client to the controller and the controller calls the getText method and passes the text.