I thought I would jump in and offer some samples that will support Steve’s position that more is possible with AIML than appears at first glance. Whether using AIML to perform math is the best idea or not I will leave to the judgement of others. Like many chatbot developers, a few years back when I first learned of AIML I wanted to be able to perform math operations. I developed some code that handled addition, subtraction, and multiplication of positive whole numbers but I grew weary of it when I got to division. I have dusted off the old experiments and have cleaned them up a little and retested the addition functionality.
I just want to reaffirm that math is possible in AIML and will be covering how it can be done in this post.
Sample Output:
Human: what is 999999999999999 + 111111111111111
sienna2: answer: 1111111111111110
Human: what is 1234 + 39
sienna2: answer: 1273
The interesting thing about AIML, let’s say you wanted to build a math tutor chatbot and you wanted your chatbot to explain how it did the math, then you could:
Human: how did you calculate it
sienna2: Working backwards from the ones place, first I added 4 to 9 resulting in 13 . I carried the 1 . Then I added 3 to 3 along with the 1 that I carried last time getting 7 . Then I added 2 to 0 resulting in 2 . Then I added 1 to 0 resulting in 1 . The final result was 1273 .
I really would like to see a neural net or a graph query explain itself and how it arrived at the answer. My explanation category is very basic and I have not spent any time adding logic to vary the language used. If I spent more time on it I would track the ones, tens, hundreds, etc places and use that in my English descriptions of the calculations; that would be better for a math tutor chatbot.