🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AIML for waitress chatterbot?

Started by
6 comments, last by Nagle 4 years, 5 months ago

I'm looking for some AIML files suitable for smalltalk chatterbot responses from a waitress NPC. The idea is that my own program asks questions like "What do you want to order" and scans the result for keywords. If the response is off-script, I want to send that to a chatterbot to get something vaguely reasonable as a reply. Then I'll ask  the "what do you want to order" question with slightly different language. Repeat until the player gets it.

So basically I need some big AIML file of irrelevant comebacks, suitable for a waitress role. There's lots of free AIML around, such as https://github.com/pandorabots/Free-AIML but none of it seems quite relevant.

Suggestions?

Advertisement

You can make your own AIML to do this. Here you go!


<?xml version="1.0" encoding="UTF-8"?>
<aiml version="2.0">
    
    <category>
        <pattern>Hi</pattern>
        <template>Hi there. What do you want to order?</template>
    </category>
    
    <category>
        <pattern>*</pattern>
        <that>WHAT DO YOU WANT TO ORDER</that>
        <template>
            <think><set name="order"><star/></set></think>
            <condition name="order">
                <li value="PIZZA">Sure. What toppings would you like?</li>
                <li value="HAMBURGER">Coming right up!</li>
                <li value="FISH">Nice healthy choice.</li>
                <li value="STEAK">How do you like your steak cooked?</li>
                <li><srai>WaitressResponse</srai></li>
            </condition>
        </template>
    </category>
    
    <category>
        <pattern>WaitressResponse</pattern>
        <template>
            <random>
                <li>Sorry but we dont have that.</li>
                <li>That's not on the menu.</li>
                <li>We don't have <get name="order"/> on the menu.</li>
            </random>
            <br/>What do you want to order?
        </template>
    </category>
    
</aiml>

If you are using AIML 2, you could put the food choices in a <set> instead. Here is a sample conversation.

 

sample.png

Are you at all familiar with what Jeff Orkin did with the Restaurant Game?

http://alumni.media.mit.edu/~jorkin/restaurant/research/

(Edit... shit, was that really 12 years ago?!?)

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

10 hours ago, IADaveMark said:

Are you at all familiar with what Jeff Orkin did with the Restaurant Game?

http://alumni.media.mit.edu/~jorkin/restaurant/research/

(Edit... shit, was that really 12 years ago?!?)

That's a neat project. It seems to have led to a commercial chatbot. The "giantotter.com" site no longer seems to host it. That site is now one of those no-info "funnel" sites that demands you sign up before they tell you anything useful.

Actually, I just want a chatterbot to handle messages that don't match the script. That way the waitress can make small talk if you get off script, then say something to get the user on script.

Yes, that's what my script will do. If the user doesn't order anything or says something off topic, the waitress will prompt him.

I've fooled around with AIML systems, and Chatterbot, which is an AIML engine with a bit of machine learning on top. They don't really do much. AIML requires that you anticipate all the questions, because it's just a template-matcher.

Right now, I'm writing a chatbot for an NPC that runs off a file of frequently asked questions. The answers are canned. The problem is matching the user's question with the stored questions. With AIML template matchers, it has to be a really close match. Is there anything with some smarts in that area? Synonyms, phrases, weights, etc.?

I've been playing around with “rasa”, the free version. I took a FAQ for a game and put it into their format to get warmed up on using it.

This is a full-blown machine learning system for matching user input sentences with patterns. Uses Tensorflow, CUDA, a GPU (that can be turned off), and is insanely complicated for what it does. It has so many pinned versions of stuff that running it in a Docker container is suggested, although, after two days of work, I got it running on Ubuntu 18.04 LTS in a Python virtual environment.

It's mostly used on web sites to do front-line customer service. Apparently there's Unity integration for this monster, so it does get game use. Anybody used it for NPCs?

This topic is closed to new replies.

Advertisement