Search code examples
xmlchatbotaiml

How would I go about making the amount of categories shorten to similarly asked questions?


I am currently tasked with a project to make a Chat bot in Pandorabots using AIML. For this project we need to create the bot with less than 15 categories (to get full marks). There is a text file we were given which had a list of 49 questions that need to be answered by this bot.

Most of the questions that are asked are like "Where is Cardiff" "Whereabouts is Cardiff" "Tell me where Cardiff is" "Where is Cardiff bot"

These sort of questions but changing the city for Bristol, London etc. I have a Github repo of the project with all the questions in there.

https://github.com/SoberBluee/courseworkbot

In no way am I asking someone to do it for me, I just need some direction on where to start because I'm very new to XML.

/files/questions.aiml is the file that all the questions are stored in.

Many Thanks.


Solution

  • Without seeing the questions, it's difficult to guide you but from the examples you gave, you need to look at the <srai> tag in AIML. This can be used to amend the user input and saves you writing lots of categories. Not sure how much guidance you need but here is an example of handling sentences that start with "Whereabouts". If the user's input is "Whereabouts is Cardiff", the bot will process, "Where is Cardiff"

    <category>
        <pattern>WHEREABOUTS *</pattern>
        <template><srai>Where <star/></srai></template>
    </category>
    

    If you need further guidance, just let me know.