AI Zone Admin Forum Add your forum

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

Combine AIML with machine learning

I’m currently using an AIML chatbot that has a purpose of interacting with players in a game environment. The purpose of the bot is to get players to trade with the bot. However, the bot has to correctly understand what the players are asking, or at least understand enough to get them to send a trade request.

I’d like a way to incorporate a learning algorithm that does two things. (1) it learns new phrases and words and puts them in the bank, and (2) adds weights to phrases based upon feedback from the program.

For example, the AIML library is programmed to respond with “trade me” to a number of basic phrases that pertain to trading. If the bot gets confused, it also confuses the players. I’d like the bot to learn from confusing interactions and get to the bottom of what players want to do more quickly. I’d also like the bot to learn new ways of phrasing things to get better results.

I’m currently using C#. Anyone have any suggestions on where to start? (I prefer open source solutions)


  [ # 1 ]

Jan Bogaerts has a “Neural Network Designer” (Download) for making dialog systems (chatbots).  I haven’t tried it, so can’t say how well it works.

The University of Southern California (USC) Institute for Creative Technologies (ICT) “Virtual Human Toolkit” ( includes “NPCEditor”, a tool for building question-answering characters based on statistical language modeling (probabilistic relevance models).

I suspect that if you compute ngrams and skipgrams, and then apply “probabilistic relevance models” that you could cluster meanings.  I also suspect that AIML production could be automated associating these clustered meanings with the knowledgebase in such a way that a conventional AIML interpreter could surface them.


  [ # 2 ]

Neural Network Designer seems like a good start, and it looks like it is written in C#.

Although, I am looking at the tutorials and they are a bit confusing at first glance. I’ll have to take a closer look a bit later.

On a different topic, I am also trying to figure out how to handle broken-up user inputs. For example:

Bot: Hello, how may I help you? smile
User: Hey uh
User: Can you buy this
User: lemme check one second
User: Okay can you buy Item #100???

In the above illustration, the AIML bot would respond to each sentence. However, this would probably confuse both the bot and the user. So I’m wondering, how can we address multiple line input or broken up input?


  [ # 3 ]

Steve would be the most help.
He has built an aiml learning set.

Aiml usually only works on one response at a time, but you may be able to achieve what you want via variables, topics, or the “think” tag.


  [ # 4 ]
Alex Ketay - Nov 12, 2013:

On a different topic, I am also trying to figure out how to handle broken-up user inputs. For example:

Bot: Hello, how may I help you? smile
User: Hey uh
User: Can you buy this
User: lemme check one second
User: Okay can you buy Item #100???

In the above illustration, the AIML bot would respond to each sentence. However, this would probably confuse both the bot and the user. So I’m wondering, how can we address multiple line input or broken up input?

I would suggest taking a look at adapting the Loebner Prize Protocol (LPP) for that.  In this protocol the bot attempts to respond whether the judge finished typing or not.  If the bot gets it wrong, so what?  It just hits backspace, and edits its reply.  After “Hey uh” the bot could hit backspace, erase or just add to the response, or replace with a new response based in the additional input, “Hey uh.  Can you buy this?” and just keep on going that until it responds to the whole thing, “Hey uh. Can you buy this?  Lemme check one second.  Okay can you buy Item #100???”  By the way, this makes it seem more natural.

My point being, as a former Loebner Prize Judge, working for world famous Professor of cybernetics, Kevin Warwick, University of Reading in the UK.  I can tell you that, that this issue is known, and there have been some good solutions made by chatbot developers for the contest.  Another standard solution, depending on your graphical user interface, may be to use a multiline textarea instead of a single line textbox.  Multiline only gets submitted when a button is clicked, not when the ENTER key is pressed… C# supports that for you.


  [ # 5 ]

Or have it say “...” or “Yes?” or “I’m here to trade.” to everything that doesn’t relate to trade or items? If the sole purpose (?) is to get players to trade, it doesn’t sound like it needs to be a conversational wonder.


  [ # 6 ]
Don Patrick - Nov 13, 2013:

Or have it say “...” or “Yes?” or “I’m here to trade.” to everything that doesn’t relate to trade or items? If the sole purpose (?) is to get players to trade, it doesn’t sound like it needs to be a conversational wonder.

Well, I’m trying to avoid people knowing it’s a bot. To date, I’ve been mildly successful .


  [ # 7 ]

Try frame based mechanism. A frame can be conceptual. To make it work, you have to devise a mechanism when something (sense) is not complete or completes. How you accomplish it, upto you.

So when user say.. “Hey uh” the sense doesn’t complete. So either bot waits for sometime or respond by some general question i.e “What you mean to say?”

“Can you buy this” can only invoke a question WHAT since “this” can’t be grounded to something this time. So bot may ask “Buy what?”

“Lemme check one second” of course means that bot must wait for answer (user searching something). You just have to give meaning to common sentence.

“Okay can you buy item #100” grounds that “this” thing within a frame or concept.

So bot now knows that user wanna sell item #100. But I think if this is only few cases like this then you can use AIML itself to take care of such things. No need to go deeper.

But if its about any general thing. Then you bot need to understand what “this” means and how to ground various words to what they represent in real specially pronouns etc along with some other minimum general concepts. That’s how it can figure out if sense completes or not. Once you process things like that then you don’t worry about the sentences or phrases but the sense if something make sense in all or is incomplete utterance so that it may respond appropriately. But that mean some core work on your part as well to complement normal AIML. You have to add concept thing into AIML with some more custom tags. Design as you like it for yourself. But if you asking for some ready made solution then I don’t think I know any. I am just a novice here wink.

And neural network for NLP I won’t recommend not for logical reasoning but I may be wrong. I have no idea of how they use neural network in NLP thing. I just have idea about how it is used within OCR or sound recognition. Using it like that may complicate your code unnecessarily more than any thing else. Basic neural network categories the various input patterns. So for pattern recognition thing its good. Logical reasoning is more about categorization as well as discrimination among things. And that sort of neural network needs training but logical network sure work on that criteria as well ...consider I mean but it learns in just one instance. Like we all do. You don’t need two instances to understand something. That;s what logic means anyway. Sure you may need for remembering things though but that also a typical behaviour of us. And sure it is not without any reason and I hope you understand why? smile So sure you can still use neural network kinda thing for upper level NLP task but a little different way then that I suppose. wink

Anyway network is network whether neural or otherwise. Nobody says what that network should be composed of anyway



  [ # 8 ]

I think I answered this here:

Are you still having issues?


  [ # 9 ]

Is that for me steve? wink


  [ # 10 ]

Inspired by what Jan said on another thread (partial quote)...

Jan Bogaerts - Jan 17, 2014:

A chatbot could be designed as an interpreter or you could hardcode it.

And for the purpose of a well-rounded discussion, here is a hardcoded candidate solution

With this suggestion we now have a candidate matrix.

Devender Singh Rana - Jan 26, 2014:

Is that for me steve? wink

This is for you Devender…  ( I meant to put this before. )

It was good to reading your post.  I wouldn’t mind reading more on frame based mechanisms.


  [ # 11 ]

Actually not being native english I just can’t comprehand some english sentences quite well unlike you guys. So I still can’t figured out how to make meaning of

“With this suggestion we now have a candidate matrix.”??? Canditate matrix what? smile

Anyway I understood your other lines so I surely wud be pouring some thoughts of mine over it in due course but currently I am going through some of your friends (MindForth’s) brain theory wiki pages. I might overhaul those points from my point of view. So maybe in couple of days. And I am not professional software engi thing so its not my whole life U C. Just a part of it ...hobby wise. But sure I wud put my best thoughts regarding the matter to you in near future. Just composing things in initial stages. But sure has blur idea about how to go for things style? But mine a restricted sense endeavour (datamining and language translation objective) so things might differ by seer difference in objectives. And Conceptual frame mechanism is so finitley engraved into whole system that you just can’t define it in few lines except for describing its various constituents. So its gonna take some time for me. But pls I am no engineer so just don’t pay much attention to my bickerings smile. I have no bot as such. I am just intrested in testing few ideas out of fun (time pass ..hobby thing). Not so serious professional. I still haven’t start on my simple database browser which is much needed for creating logic of program itself than any other thing. So lets me first finish with mindforth brain theory first. I am trying read it for last couple of days but something distracts me so I am doing it in paragraphs ....heheh!. That’s my speed of doing things

But basically I am thinking of breaking the sentence into conceptual entities or whatever entities and then using those entities and thier basic relation to each other to some use for logic reasoning. So you can start with few basic abtract and necessary concepts or entities and build other entities or concept with them (even by bot). If certain entity can’t be fully define by some other basic or known entity then its time to introduce some new basic entity (fragment part most probably). simple enough logic. Some Basic abstract entity or concpt defination might demand bot master interference or coders but would like bot itself be able to build complex concepts out of simple ones. That’s how also a bot can figure out which sentences it don’t have understanding of. So you can easily browse those sentences in arious ways and figure out the logic to solve the bottleneck. Yeah some errors might be there on account of any whatsoever reason, like as simple as same word refering to two different entity or concept but you just provide means to correct such rare situation easy enough with whatever means and it won’t be that much a big problem. I hereby aint after the best way possible but the way itself my policy so by whatever means it get accomplish good for me. First a screw driver should work likea screw driver to be called like that. Its other features or uses can be valuable too in some sense but it doesn’t make it to be called screw driver. If you using it like hammer than its hammer of course. Its just a try to solve the problem logically that’s all. Will have its limitaions as well as benifit as any other thing but who doesn’t? Even we not so expert at every aspect of thing. wink

Last of all, just ponder over your thinking process, just am after something like that if not all. wink

But I think I asked steve, No? Do he still prefer covers? And what issues you talking about steve? ...Does my simple post to a open topic. I mean its not closed topic, no? Yes I seen your solution but I haven’t writern my post keeping yours in mind. They just my thoughts I putted there for the sake of feeling like to say something and relevancy of topic ...not even for Alex Ketay himself, who posed the question in first place. Its quite old post I have noticed that I might be intentional absent minded about some things but not that much thast I didn’t noticed such small things. That’s not right way to assess somebody Mr. Steve. ...heheh! And if you really want to talk to me then why such sword play. You can ask me for anything sensible I suppose. Judged by my previous experience I won’t take that risk So there isn’t have to be some reason for everything steve at least not in some specific way. Sometime happening itself become a reason for itself ...if you can sense this? Here I think you trying find specific reason then reason itself or else you might have ignored my post. How could this thing can by any means related to any sort of issues?  Or I am missing some humor sense here brother. I am not so humouristic person sorry to admit, unlike you Mr Squarebear - ? You not trying compose here some ..virtual dance steps steve, are you? ...heheh! like I told you last time bot-bot game I still don’t do that. Count me out of it. My privacy is far more valauble to me then my senseless ego. We not that much aquainted to have any such issues, are we? At least I don’t know you and I think you also talking here as just another stranger to me on net, no? You hardly know me, don’t you? Or am I illusioned about that? You see steve the grounding problem, same as “this” in that problem case. So trust is another fundamental element in unpredictable domain which you must account for in your logic. Just see your just three words (out of context) created all this typoon in my otherwise calm thought process. An now I am been called into some matrix by some other new person from your side. Hey guys! I am not in for some game here. I try live a peaceful self that’s all enough for me. smile

And Mr Steve, don’t be like our renwouned state of art antivirus products. They have a notorious habits of doing out of context jobs wink. But by the way when did you come into site management team? Last time you wren’t in that, were you? Anyway it was quite brief one so couldn’t say for sure. Anyway I think I have asked for any issues in some mail .. I think ..somebody just din’t thought it worthy of replying but here the same person just dunno somehow found it relevant to raise some “issues” things out of nowhere. So what do you think here is working lika in MindForth sense… is enviroment trying infleuning the mind or mind influencing the enviroment ...heheh? 

Did you noticed steve I used both “But by the way” there… heheh!

Last By the way of all by the ways, time to go for mindforth thing…smile. See instead of working on my thing I am reading others out of simple curiosity. That tells my seriousness about my project. But if I come up (compose) with something presentable in meantime I wud be posting it here or at my forum at “”. You know, I am the only member there wink and most importantly I don’t mind ...haha!













  [ # 12 ]

Not quite sure why the rather confrontational post there. We rarely close topics unless they get out of hand. I answered the question and so assumed someone else was struggling, hence my post.

Netiquette says to start a new thread if you wish to take the topic off at a tangent, rather than bumping up a 2 month old thread.

But by the way when did you come into site management team?

It was last year when Dave had his accident. I was asked to become a moderator to help him out while he recovered.


  [ # 13 ]

but in case of “Can you buy this” ..

you just need to define a buy concept in term of some basic entities like buy demands a actor buyer and a entity that is brought or sold. Now when bot encounter “buy” it tries to fill those ..lets say variables with instance variable. You can be easily guessed but “buy” introduced incompleteness in the name of buyied entity. “This” is just a pronoun (abstract class) not a instance of something. So this doesn’t identify something fully. So the bot knows what thing is missing, a entity in this case. By previous use of simlar sentences conforming to such use of “buy” sense (same path), it can guess to some extend, what could come in place of this. Why concept (another fundamental) may filter out some. Basically its all about categorisation and some basic rational logic but just in somewhat liberal sense. Any property can be criteria for categorisation. So a new entity can introduce further new categories or entities. Entity itself can be successfully assumed as a collection of various properties in most cases. See I never checked all the posibility so I joined the “in most cases tag”. Maybe in future it may hold some value or zero value. Problem solved! hhhaha. Such extra marking don’t hurt that much as temp measure. This is one way of problem solving. Assuming that there could be some error.

In real world senario lot of times rules are rules cause they happened to happen like that. They are not expected or thought about. This is the ground realities for humans here. The simple reason that you can’t figure out the reason balances the network in its own way somewhat. So the thing is its not all the combinations (hypothitecal in a sense) that is the problem. That’s why you use dynamic arrays or structures. Real life things are itself dynamic in that sense. A lizards tail don’t grow with break(gap) inbetween. Its basic law of nature which is objects baisc property ...heheh! Okay have you seen a lizard whose tail like this sort..

>>>>>>>  (space)  >>>>>>>

some other time…gtg



  [ # 14 ]

All I wish is steve smile smile

cya some other time… I still cant go to mindforth thing u c ... but I am gonna complete that thing in day or two… still a slow reader. smile

cya steve!


  login or register to react
‹‹ Easter eggs      AIML Versus Script Learning ››