I recently learnt about AIML and tried creating a chatbot using python-aiml .. I was curious if a multilingual support can be added? Anyone got any idea how? I know this is the age of AI & ML but i am just being curious!
What i was thinking is to create different kernels for different languages and then detect the language of users input and use the corresponding kernel to get the response...
Any other ideas would be appreciated!
I do this by having Google translate API act as a middle man between the user and the bot. Here is an example:
French user says, "Bonjour"
(Google translates this to English and passes "Hello" to the bot)
Bot receives "hello", processes it and replies, "How are you?"
(Google translates this to the user's language passes "Comment allez-vous?" to the user)
...and repeat
If you have categories that check the user's language, you could also do something like below, which will give a different response for each language (notice the last li of hello? It's important to have a catchall in case nothing else matches)
<category>
<pattern>GreetUser</pattern>
<template>
<condition name="language">
<li value="French">Bonjour</li>
<li value="German">Guten Tag</li>
<li value="Italian">Ciao</li>
<li>Hello</li>
</condition>
</template>
</category>
Failing that, you will have to manually translate your AIML files into whatever language you need.