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..

Can you help, please? Should I use AIML on my project.
 
 

Hello everyone! And Good morning!

I’m actually researching on Chatterbots for my Master’s Degree and I was considering the options that I have available.
Naturally, AIML jumped out on the web searches, but I’m not sure this is the best option (and I’ll tell why later on this Topic).

First of all, let me explain a little about that Project:

Start of “the Project”
My field of study is the use of Computers in Education. Therefore, I’m interested in the development of a Chatterbot for Educational Purposes.

The main idea is that the user will be able to “TEACH” something to the bot.
There is no defined subject. The important part is that the user will set the theme.
The more complex and specialized that explanation is, more the bot will “understand”.

The bot will create a Knowledge Base with the explained subject, will convert it to a Predicate Logic and will update his Knowledge Base with the explained Propositions AND the Propositions that can be inferred using Predicate Logic.

With this project, I’m aiming the creation of a chatterbot that allows the user to explain his ideas and thought about anything, while the bot can help with his Construction of Knowledge, inferring new Propositions, questioning the Propositions said by the user and even linking URL from Articles about that theme, helping to direct the users studies.

The bot’s Knowledge (and therefore the AIML file) will be “blank” at start (not exatcly blank, but It won’t have useful information about the theme because… well, the bot don’t know the theme yet). The user will set the theme and will explain it. This way, I’ll need to “re-write” and reload the AIML file each and every interaction from my user.

A really simple example:
Let’s consider the user just started the chat:
-> User said: Can you tell me what are Rocks?
-> Bot: I don’t know that yet! What can you tell me about Rocks?
-> User said: Rocks are Human Beings.
-> Bot: Ok, I understood that! What can you tell me about Human Beings, then?

The bot is unnable to question the clearly wrong proposition, because he knows nothing of Rocks, nor Human Beings.

Let’s consider this:
-> User said: Can you tell me what are Rocks?
-> Bot said: I know that Rocks are Human Beings.

Now the bot knows that new concept. If I want to use AIML, I’ll need to understand the predicate logic (rocks—- ARE—> human beings) and I’ll need to create a new “category” tag on my AIML file and then reload it. If I don’t reload it, the bot will say “I don’t know that yet! What can you tell me about Rocks?”, since the file isn’t updated with the new proposition.

One last example, considering the User just started the chat:
-> User said: Can you tell me what are Rocks?
-> Bot: I don’t know that yet! What can you tell me about Rocks?
-> User said: Rocks are Human Beings.
-> Bot: Ok, I understood that! What can you tell me about Human Beings, then?
-> User said: Human Beings need to breath.
-> Bot: Ok, I understood that! What else do you know about Human Beings?
-> User said: Rocks can’t breath.
-> Bot: Ok, I understood that! What else do you know about Rocks?
-> User said: Can you tell me what are Rocks?
-> Bot: I know that Rocks can’t breathe! Can you tell me anything else?
-> User said: Rocks are Human Beings?
-> Bot said: No, they aren’t. You said that Human Beings need to breath, but Rocks can’t do it.

The user explained the opposite to the bot, but using Predicate Logic, the bot inferred that the user was wrong.
This may look simple now, with an empty Knowledge Base and simple “‘SOMETHING’ is ‘OTHER THING’” phrases, but this bot can become really smart with usage. The more you detail, the more complex the bot’s logic will become. As soon as he learns about one topic, he can even correct the user when he says something wrong, since his Knowledge Base will be kept. If another user start that bot now, It will already know about Rocks and Human Beings. You don’t need to teach him again.
Another important concept is the Backtracking. The bot not only told the user was wrong, but explained how he reached that conclusion. This is important to help the user. Only saying he is wrong (and not telling why) can be as much of a problem as not correcting him at all.

I’ll create another module where the bot will search for Cientific Articles to suggest. For example, instead of just saying that he was wrong (about Rocks being Human Beings), It can suggest a Cientific Article about the definition of Human Beings. This will certainly be helpful if the user is questioning If “THINGS” are Human Beings.

End of “the Project”

Ok. If you read everything, you’ve already understood the project, so I can ask:
Is AIML a good option for that project?

As you’ve seen, for each and every human interaction, I’ll need to:
1) Process the input
2) Transform the input into predicate logic and save it
3) Create a “category” tag on my AIML file, with the pattern typed and the template found (or inferred)
4) Reload the AIML file
5) Answer to the User

Not to mention that I’ll search for Articles on the Web (probably I’ll use Google Scholar Parser).

I know that I can load the AIML files multiple times, but that delay will be at least acceptable, considering it will happen EVERYTIME you type something?

Anyone that have enough experience can give me any advice about this?
If you don’t think AIML will be a good choice, can you suggest other options (and tell me why you’ve chosen it), please?

Thanks a lot for your time and help!

Best regards,
Bruno Gutierrez Ratto Clemente.

 

 
  [ # 1 ]

AIML can do most of this. The only part it will struggle with is reloading the AIML after each interaction. You would constantly need to republish your bot and this would be impractical.

AIML is perfectly capable of learning but ONLY for the current user. This is to avoid the old:

Human: Tony is fat
Bot: I will learn that
Human: Who is fat?
Bot: Tony
Human *arf* *arf*

You wouldn’t want that shared among all users.

You can use <learnf> to write categories to a file but these new categories will only be shared among other users if you constantly republish.

 

 
  [ # 2 ]

Learning facts and inferring on them on the fly may be within the realm of possibilities of AIML (?) but I don’t think chatbot scripting languages were practically built for this sort of thing. What you describe sounds much more exactly like an ontology + inference engine combination, such as there are Project Cyc http://en.wikipedia.org/wiki/Cyc or the SUMO ontology http://www.adampease.org/OP , but those don’t offer much in terms of dialogue interaction on their own, they are just separate components for AI systems. ChatScript seems to be somewhat compatible with fact triples and the Wordnet ontology as recent discussions in that subforum indicate.

I programmed the sort of thing you exampled from scratch, but that took me about two years. I’d recommend grabbing yourself an ontology somewhere, and if the inputs always stick to simple formats, you might be able to program the keyword parsing and definition comparison (rock <-> human being) yourself in a year’s time. If you want to infer more than just definitions or want more natural conversation than an exchange of facts, I don’t think I have any feasable advice. It’s a tall order (but then that’s why it’s a Masters Degree I suppose).

 

 
  [ # 3 ]

Good evening / morning

This sounds a very interesting project, and something that is becoming topical in the current state of bot development. Please excuse my lack of knowledge, but what does ‘Predicate Logic’ mean in simple terms? Also what is meant by ‘Propositions that can be inferred using Predicate Logic.’

Also in your example we know Humans breathe and Rocks are Humans. Then we have:

1 -> Bot: Ok, I understood that! What else do you know about Human Beings?
2 -> User said: Rocks can’t breath.
3 -> Bot: Ok, I understood that! What else do you know about Rocks?
4 -> User said: Can you tell me what are Rocks?
5 -> Bot: I know that Rocks can’t breathe! Can you tell me anything else?

As we know humans can breathe, in step 3 why can’t the bot hilight the inconsistency by saying something like ‘I don’t understand, you said Humans breathe and they are Rocks but Rocks can’t breathe’. Maybe I don’t understand enough about predicate logic.

Anyway this is an interesting area, as one criticism of chatbots is they can’t learn anything new (AIML learn tag aside), other than what their botmaster programmed into them. But this project seems to have the ability to ‘learn’!

 

 
  [ # 4 ]

Speaking of inconsintencies in logic:
1. The Rolling Stones are humans. Your capitalisation of Rocks allows the same ambiguity without conflicting with the properties of rocks.
2. Facts of need and ability do not necessarily contradict one another.
3. A single fact should not be taken as full proof, or you can get very odd jumps to conclusions (I’ve been there). The single fact that a penguin can not fly is not full proof that it is not a bird. A definition is made up of multiple facts and to any general rule there can be exceptions.

Also, since you first told the AI that rocks are humans, then told it facts that prove the opposite, the AI should at this point no longer be certain what to conclude, as they are both things you said. Should indirect deductions overrule directly taught facts?

 

 
  [ # 5 ]

Maybe you could use rivescript? You could use the javascript macro to post data to a php page,and write to the said brain file,and then reload the files. You can log the chat history externally and reload that , giving the illusion of the chat being continued. Rivescript is quite beginner friendly, and you could undertake a small experiment to see if this idea might work.
I’m sure senior members and Noah Petherbridge(creator of Rivescript) could throw some more light on this approach?

I’m relatively new to chatbot development,and my ideas might be far from feasible,so bear with me. Just an idea smile

 

 
  [ # 6 ]

A couple of the RiveScript implementations have features to support programmatically manipulating the replies the bot knows. The Perl and Python versions both have a “deparse()” method, which exports the entire bot’s brain as a JSON serializable data structure, which makes it easy to add new replies from your program, like…

my $brain $rs->deparse();

# add a new reply
$brain->{topic}->{random}->{"hello bot"{
    reply 
=> "Hello, human!" ],
};

# write the deparsed data back into a RiveScript file
$rs->write("brain.rive"$brain); 

The Perl version got this feature because I was working on a bot hosting service, which had a graphical web interface for building your bot’s brain, and also supported importing existing RiveScript files and exporting your bot as RiveScript to download/back up locally. Python got the deparse() function too, because I like Python better these days and might try again at a bot hosting service. wink The deparse() function isn’t very well suited for a bot to learn new things while it’s running, though; for example the only way to get the deparsed brain back into the bot is to `write()` it to a file, and then `loadFile()` it back into the bot.

So, something else I’m considering is to add a “learn()” function to ALL implementations of RiveScript, as an extremely programmer-friendly way of dynamically adding new replies. It could look something like this:

when i say you say *
OK.<call>learn <star1>::<star2></call>

object learn javascript
    
var parts args.join(" ").split("::");
    
rs.learn({
        trigger
parts[0],
        
replies[ parts[1] ],
        
// other valid keys would be `redirect`, `condition`, etc.
        
write"./brain/learned.rive" // permanently store it in a .rive file
    
});
    return 
"";
object 
 

 
  [ # 7 ]

First of all, THANK YOU everyone for participating !

Let me reply some of your questions:

Steve Worswick - Mar 30, 2015:

AIML is perfectly capable of learning but ONLY for the current user. This is to avoid the old:

Human: Tony is fat
Bot: I will learn that
Human: Who is fat?
Bot: Tony
Human *arf* *arf*

You wouldn’t want that shared among all users.

Thank you very much, this is really interesting! I’ll keep an eye open for this kind of statement.

Don Patrick - Mar 30, 2015:

What you describe sounds much more exactly like an ontology + inference engine combination, such as there are Project Cyc http://en.wikipedia.org/wiki/Cyc or the SUMO ontology http://www.adampease.org/OP , but those don’t offer much in terms of dialogue interaction on their own, they are just separate components for AI systems.

Thanks! I’ll read about It to see If I can use it somehow.

Will Rayer - Mar 31, 2015:

Good evening / morning

This sounds a very interesting project, and something that is becoming topical in the current state of bot development. Please excuse my lack of knowledge, but what does ‘Predicate Logic’ mean in simple terms? Also what is meant by ‘Propositions that can be inferred using Predicate Logic.’

Also in your example we know Humans breathe and Rocks are Humans. Then we have:

1 -> Bot: Ok, I understood that! What else do you know about Human Beings?
2 -> User said: Rocks can’t breath.
3 -> Bot: Ok, I understood that! What else do you know about Rocks?
4 -> User said: Can you tell me what are Rocks?
5 -> Bot: I know that Rocks can’t breathe! Can you tell me anything else?

As we know humans can breathe, in step 3 why can’t the bot hilight the inconsistency by saying something like ‘I don’t understand, you said Humans breathe and they are Rocks but Rocks can’t breathe’. Maybe I don’t understand enough about predicate logic.

Thank you very much! And YES! You are Correct! I had already considered this, but the explanation would be even longer If I tried to explain that too. I kind of ‘hoped’ no one would notice, but you actually did! Also, the answer you gave is the same one as I did: Whenever I found a contradiction, I ask the user which one is wrong.
When I’ve used the term “Predicate Logic”, i was referring about this (http://en.wikipedia.org/wiki/Propositional_calculus).
For example, I can use predicate calculus to find errors, induce new rules and find contradictions:
Eg> If it is not a rainy day, I’ll go to the beach. I can write it as ‘p -> q (that can be read as “IF NOT P, THEN Q”), therefore, I can apply other technics, like Modus Ponens (http://en.wikipedia.org/wiki/Modus_ponens) to induce new propositions.

Don Patrick - Mar 31, 2015:

Speaking of inconsintencies in logic:
1. The Rolling Stones are humans. Your capitalisation of Rocks allows the same ambiguity without conflicting with the properties of rocks.
2. Facts of need and ability do not necessarily contradict one another.
3. A single fact should not be taken as full proof, or you can get very odd jumps to conclusions (I’ve been there). The single fact that a penguin can not fly is not full proof that it is not a bird. A definition is made up of multiple facts and to any general rule there can be exceptions.

Also, since you first told the AI that rocks are humans, then told it facts that prove the opposite, the AI should at this point no longer be certain what to conclude, as they are both things you said. Should indirect deductions overrule directly taught facts?

Thank you! I wasn’t considering Rolling Stones to be related to Rocks, really! But It was very insightful from you.

About the 3rd subject, this is one reason I’ve chosen Predicate Logic, I can use the quantifier symbols “∀” (http://en.wikipedia.org/wiki/Universal_quantification) and “∃” (http://en.wikipedia.org/wiki/Existential_quantification).

About the indirect deductions, you’ve reached the same logic as Will Rayer and, yes, you are both correct. This would never happen in a real conversation, because as soon as the bot’ve found the contradiction, he would ask the Human which concept was correct. Therefore, the conversation would never reach a point where the induced rule would overrule the told one, because as soon as the user says something that will create that “indirect deduction that overrules a directly taught fact”, the user would be prompted.

Also, thanks both Siddharth Gupta and Noah Petherbridge. I never heard of RiveScript, but I’ll do some research! Thanks again!

The only problem with this whole project is that a bad user (an user that won’t teach enough to the bot) will have wrong answers from it.

If the User says: “Rocks are Human Beings”. and “Rocks can’t breath”, the bot will learn it. We know this is not correct, but the bot can’t argue yet.
If the User asks: “Is there any Human Being that can’t breathe?” the bot will say YES, THE ROCK.
Apparently, my teachers have a really huge problem with the “your bot is teaching something wrong”, so I’m not sure I’ll be able to implement it that way.

Thanks again, everyone!
I’ll keep in touch, updating this post, if anyone is interested about it !

 

 
  [ # 8 ]

On the topic of learning its replies from humans, you will get trolls who will just fill the bot’s brain up with random junk, swear words, etc.

The bot should tag things it learns with meta data such as which user taught it that reply. Then if you find an abusive user that’s teaching it bad stuff you can easily block the user and remove everything that came from them in the bot’s brain.

Source: once upon a time I wrote a learning bot. It would simply keep track of the order of messages, so in the beginning you say “hello” and the bot knows nothing so it repeats you. Then you say “what’s up?”, and the bot repeats you again but it keeps in mind that “what’s up” is something that follows “hello”, so that when another user says “hello” to the bot it would reply with “what’s up” rather than repeat them. It was a very simple system and was pretty impressive in the beginning, but then I put it on the Internet where random strangers could chat with it, and they weren’t as impressed with its learning ability and lost patience with it, and the rest is history. This bot wasn’t keeping track of who taught it what so it was a big mess to clean up. wink

 

 
  [ # 9 ]

I believe that’s also how Cleverbot works Noah.

 

 
  [ # 10 ]

I think that’s the basic idea of Cleverbot, but I think they augment its learning with some custom code that gives it the ability to remember user variables (like name), and remember what the bot said to that particular user earlier in the conversation.

For example you can chat with Cleverbot in two different tabs and ask what its name is; it will give you a different answer on each tab (from one of the randomly learned names from its prior conversations). But it will stick to its story for the remainder of the session. Chat with it about a bunch of other stuff and then come back to the name question again and it says the same answer as it did the first time, and stays consistent on each tab.

 

 
  [ # 11 ]

Having an AI that heavily relies on inferences, I have to say that the problem of your chatbot reaching wrong conclusions will always be present, either because you’re using strict true/false logic or because the computer does not have sufficient information as you’ve said. If you are expecting the user to provide all information, then the user would be doing more teaching than the program. Have you read about expert systems? This form of AI used if-then rules as knowledge base with an inference engine very similar to your description. They were successful at first, but fell in disuse because (so the story goes) it took many experts to teach it all the rules, before it could teach something correctly to anyone else.

The question is: How is an AI that relies on the user to give it information, going to teach the user anything that the user can’t easily infer himself? How complex is that AI going to need be to do more than basic inferences? I think it would be easier to teach new and correct information to a human if the program already has a filled knowledge database. Wordnet, Conceptnet and Project Cyc are a few knowledge databases that I know of that you might use.

P.S. The Rock is very much a human wink

 

 
  [ # 12 ]
Noah Petherbridge - Apr 6, 2015:

The bot should tag things it learns with meta data such as which user taught it that reply. Then if you find an abusive user that’s teaching it bad stuff you can easily block the user and remove everything that came from them in the bot’s brain.

Thanks for the advice! I’m not really sure how this project will be designed, but I’ll keep that in mind.

Don Patrick - Apr 8, 2015:

Having an AI that heavily relies on inferences, I have to say that the problem of your chatbot reaching wrong conclusions will always be present, either because you’re using strict true/false logic or because the computer does not have sufficient information as you’ve said.

Yes, there will be problems. What I’ll try to do is design solutions for those problems.
For example, the propositions could have “weight”. If a lot of users complain about a inferred conclusion, It could be considered “uncertain”.
I don’t know that yet, but I’ll have to find alternatives.

Don Patrick - Apr 8, 2015:

If you are expecting the user to provide all information, then the user would be doing more teaching than the program.
(...)
The question is: How is an AI that relies on the user to give it information, going to teach the user anything that the user can’t easily infer himself?

You are correct! The answer is within the user, not the bot.

There are many pedagogues (I’m not sure if I’m using this word correctly, but ok) that states that you can never GIVE the answer to a problem, because you are taking away the learning process from the apprentice. Of course, the apprentice should be corrected and directed, but this bot is focused on DIRECTING the user, instead of TEACHING the user.
There is also a Therapy model called “Rogerian Therapy”, or “Person-Centered Therapy”, that states that the answer to someone’s problem is within that “someone”. The bot is also designed to fit into that concept.

If you teach something to the bot, but you don’t know about it yet, that information is limited.
The bot will understand little about that subject, so he’ll recommend you “general articles” about the stronger words found in your explanations. (and I’m assuming that my user actually will read those general articles, of course).
Now I’m assuming you understand more about the general concept you’ve studied.
Maybe you can even found specific domain that interest you, so you log back to the bot and explain about your “new found knowledge”.
Giving more domain-specific information will “lead” the bot into recommending you articles less general, more focused on that domain.
The process repeats as long as you want. As long as you keep studying and keep “feeding” the bot with information, the bot will be able to recommend you more and more articles.
Another thing: more information means more chance of mistakes. That means that as long as your explanation get more complex, more chances that the bot find mistakes. If It can’t find any, well.. Good job!

An Example:
You ask the bot what he knows about “User Interfaces”. He says he knows nothing.
(If you know something, you can explain, but I’ll consider you know nothing about it, too.)

You say that you don’t know about it too. He will search for articles related to the expression “User Interface”.
For example, he gives you this: “User and task analysis for interface design”

You read about it and find out a lot about User Interfaces. You explain to the bot your new found concepts. Since you have explained about User Interfaces, he’ll keep finding articles related to that subject.

Let’s say he recommends you an article about using Webcams to improve the User Experience.

Maybe from that reading you’ve decided that this area is interesting, so you explain about how you can use the Webcam to track the Eye’s movements, to find problems on the navigation of webpages. You explain that and the new article the bot will recommend won’t be general, It will be about that specific domain.

If you misunderstood a concept from that reading, maybe the bot can correct you through logical inference.

I hope that explanation helped understanding how THE USER is the center of this process, therefore he’ll teach himself, with concepts he already know (or at least he thinks he knows, since he can be corrected).

 

 
  [ # 13 ]
Bruno Gutierrez - Apr 10, 2015:

this bot is focused on DIRECTING the user, instead of TEACHING the user.
There is also a Therapy model called “Rogerian Therapy”, or “Person-Centered Therapy”, that states that the answer to someone’s problem is within that “someone”.

I see. So it’ll be more like a study buddy. That could work, even without inferences. I take it you have heard of the Rogerian psychologist chatbot Eliza?

 

 
  login or register to react