AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Rank between pattern
 
 

Hello everybody,

I have the following question:
Until now, my Bot has two pattern.


000001: <category>
000002:    <pattern>
000003:      HELLO *
000004:    </pattern>
000005:    <template>
000006:      Hello, my dear.
000007:    </template>
000008: </category>


000001: <category>
000002:    <pattern>
000003:      * [badWord]
000004:    </pattern>
000005:    <template>
000006:      That’s not nice.
000007:    </template>
000008: </category>

When I write as an input: “Hello, my friend”, he answers with “Hello, my dear”, which is completely right. But when I write: “Hello, you [badWord]”, he decides to say: “That’s not nice.” Now I wonder, why he answers with “That’s not nice” and not “Hello my dear”. Of course, both answers are correct, but he always decides to take [badWord] as the pattern. And I wonder why. And if there is a way to make him answering the other possibility.

 

 
  [ # 1 ]

Hi there, Mr. TB, and welcome to chatbots.org! smile

In order to be able to accurately answer your question, I need to know which AIML interpreter you’re using. No two AIML interpreters handle choosing the “most correct” response in the same way, so it’s difficult to give you some useful information without specifics. Some interpreters give more “importance” to wildcards found at the front of a pattern (in your case, “* [badWord]”), and some do the same thing with wildcards at the end of a pattern, while others choose randomly between all found matches that score the highest. For example, with Program O, a PHP-based interpreter, both of those patterns would score around 35 points each, with another pattern (“RANDOM PICKUP LINE”) scoring only 7 points. Thus, the response output would be a randomly selected choice between the two patterns you’ve outlined.

Also, I corrected a slight issue with the PATTERN tags, that keeps them from being visible. When trying to display HTML or AIML tags (or any markup tags, for that matter), it’s best to wrap your code in [ code ] tags (without those spaces) to let the forum script know that you want it displayed as is, and not use them as markup tags. Another method is to ues the HTML entity code for the left tag bracket (&lt;) as a replacement for the < symbol.

And lastly, I removed the “foul language” in your post, and replaced it with [badWord]. I know that the word is nowhere near as bad as some others, but this is a “family friendly” forum, and I moderate these pages as if I were the parent of a young child. If that upsets you, then I’m sorry, but that’s my job, and I take it seriously. smile

Meanwhile, I hope that this post helps, and I’m looking forward to learning more about you, and your chatbot project(s).

 

 
  [ # 2 ]

Oh, I’m so sorry because of the bad word. Where are my good manners.  I didn’t think about it, but you are totally right. Will make it better the next time. Also the thing with the code. It’s my first time here so I hope you forgive me smile

Puh, it’s even more complicated than I thought. So I guess I just tell about my project. I want to make a universal Chatterbot architecture. Combining all positive aspects, the chatterbots you can find in the web have, without the negative sides. And at the end, I (or someone who uses my architecture) only has to write the script with the personality and vocabulary, the Bot should have. That way you can create a lot of Bot Personalities, using the same architecture.
That’s the idea (I want to hold that as a graduation project at my university).
In that case, I need an Interpreter, which allows me to make as much chances as possible on my own. Like, for example, the issue with the two pattern I mentioned above. I took “Gaitobot AIML Editor”, because it was the first one I found. But in retrospect it doesn’t seem to be the best choice.
So… if I should take another Interpreter (to solve my problem and according to my project), I would of course take another one. It’s currently all new for me smile

 

 
  [ # 3 ]

I wouldn’t worry all that much with the language thing. Lord knows that I’ve “slipped” in polite company enough times. smile

As far as the AIML interpreter, I believe that GaitoBot is one of those editors that places slightly more priority on wildcards that appear at the beginning of a pattern. I’m not 100% certain of this, since I’ve never seen the source code for the program, but I’ve tested it out enough to believe it, based on scenarios that were very similar to what you’ve described.

Since this seems to be a University project, I would recommend using a “stand-alone” interpreter, since they’re much less work to set up than a web-based solution, such as Program O, which requires not only a web server, but also a mySQL database server, and a solid knowledge of several web-based languages. Some options for you are:

1.) GaitoBot AIML Editor/Engine (which you already know about)
2.) AIMLPad - Written by our own Gary Dubuque
3.) Program N (Oh, wait! Program N and AIMLPad are the same thing! Silly me!)
4.) RebeccaAIML

There are others, as well, but these should provide you with a decent sampling of programs to choose from, for now. I have absolutely NO experience with RebeccaAIML, so I don’t know if it will work for you, but it’s certainly worth a try. Judging from what little I’ve read about it, it’s already an executable application, rather than C++ source code, so at least you don’t have to compile it. smile

 

 
  [ # 4 ]

For a university project, it probably would be advisable to use an interpreter that closely follows a standard (like ChatScript.)

The AIML standard says the _ wildcard matches first, then words match, and lowest in priority is the * wildcard. If “Hello, you [badWord]” is an exact match to a pattern, it has priority over the pattern containing the * wildcard.  Actually the graphmaster matching algorithm is a little more complicated, but the AIML standard says it is deterministic producing one and only one result for a given set of categories and input.

AIMLpad has a ddl version that is an ActiveX ocx control. It contains many of the functions that the editor’s interpreter has, but not all.  It can be embedded in other applications like Flash for your own avatar or MS Excel as the sample in its download does, etc.

The AIMLpad editor on the other hand with its scripting language and character bible and lexicon can be programmed to create the AIML sets from text files. In fact some work has already been done as an option in the editor’s tools to convert text like a script for a play or a television show into categories.

Although its NLG command only makes surface realizations right now, script could be written to select vocabulary from concepts and templates for the style of English prose such as active or passive voice, etc. to simulate personality types (as defined also by the character bible?)  I was in the process of chunking inputs into RST and then using that to plan the utterance for the given personality in the character bible when I took a vacation from programming for these last few months.  So while it can be written in AIMLpad’s scripting language now, someday in the not too distant future (at least towards the end of next year) it will become one of the editor’s tools or a command or function in the language, that is, built in and more automatic.  Then in a conversation with the bot, you can correct it verbally with the way it should have responded and it will create/edit the AIML categories outputting the “voice (or style)” of the personality defined in its character bible.

Try AIMLpad.com for the latest release or for the dll (all source is included.)

 

 
  login or register to react