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

My little chatbot project…
 
 

Hi Everybody,
I’ve been away from Chatbots.org for a couple of months focusing on starting and maintaining an organic garden in the backyard.  It’s been a great break from programming and has allowed me to think about my first chat bot program.  The weather is beginning to get very hot and humid here in the Carolinas so I’m apt to spend much of my free time this summer inside at the computer.

Here’s a basic design spec.

Goal: Create a virtual character that lives in a 3D world that is 1km x 1 km. The world consists of natural features (trees, hills, streams), man-made features (buildings, power lines, etc.), and critters of various types.  The virtual character communicates via simulated ‘text messaging’ with the human.  It can answer various ‘where’ formatted questions in absolute and relative terms. It can obey simple exploratory commands related to its environment.

Purpose: I always like to ‘reinvent’ the wheel…and generally produce something with too many sides to roll correctly. However, now and then, even I get lucky. =) I simply wish to give this a go. It should be a good blend of my interests: game programming, gardening and the outdoors, and wanting to make a chat bot.

Development: I’ll write the code in C++ using Visual Studio. I’ll create data files using Excel. The initial application will be a simple console window. Graphics (DirectX) and sound will follow if the initial code is satisfactory. I don’t want to be distracted by the bells and whistles of such a project.

Design Objectives: (not listed in any particular order)

1) Create general object library that represents ‘general knowledge’ of the world such as trees, buildings, birds, etc.  Library format will be defined and a tool developed to add knowledge.
2) Create a virtual world that draws upon the the general object library to create unique and varied instances of the objects. E.g. various types of trees at various heights and in various conditions.
3) Create virtual bot that has the ability and simulated ‘will’ to explore his world. NOTE: He’ll start off as a guy so my wife doesn’t become jealous or the time I spend with her. =)
4) Employ physics so the bot avoids obstacles.  Includes simulated vision, audio, and olfactory senses.  This means that a module or interface must be developed between the virtual bot and the virtual world to simulate senses.
5) Implement curiosity mode so he stops, observes, and stores details in short-term memory. Initially objects in the world are static but eventually will move (critters) or change (tree colors).
6) Develop ability to respond to questions such as:
  a)  Where is the gray hut?
  b)  Where is the car?
  c)  What is that in the tree?
  d)  What is that behind the building?
  e)  Where are you?
  f)  Where are you going?
  g)  Where does the eagle live?

Limitations: The focus is upon the location of the bot and things in his virtual world, the use of prepositions and other means of specifying relative locations and the bots orientation in the world.  No emphasis will be placed on other aspects of chatting such as general conversation, abstract concepts, wit and sarcasm, etc. Perhaps later if this actual works!

That’s about it. I would like to work on this over the summer months and conclude in the fall.

If you have suggestions or questions, please let me know. I’m still in the ‘thinking’ part of this project and have yet to write any code. I have a significant amount of ‘infrastructure’ to create so that the bot has the capacity to ‘grow’ along with its virtual world.

Regards,
Chuck

 

 
  [ # 1 ]

Welcome back Chuck! Have to run for a weekend out of home, but here is my first suggestion:

If a virtual character is walking around in the 1kmx1km square (for example in an organic garden in the backyard), he probably notice a lot of things (happening around, or just static). Wouldn’t it be awesome to create a twitter feed:

sitting in my backyard, very hot in Carolinas, but nowone to talk to.

OR

talked the whole days, my throat sores

something like that, wouldn’t that be cool?

 

 
  [ # 2 ]

This is an interesting approach.  In my project, I am highly focusing on grammar as the first step.  Most bot developers do not do this, but I give credit to my wife for recommending grammar as the first step.  Preliminary results look very promising.

With your project, you are going at it from an experience/example in order to understand language.  That is a very good idea as well.  You are starting at an even lower level.  I can see from your sample questions that you will probably focus on having the bot learn nouns first (what is that, where are you, where is the hut).  I imagine that will go quite easily for you.

The big challenge is finding a way to have the bot learn verbs.  May I suggest you create a avatar for yourself in this virtual world, you could then for example see if you could teach it the world “jump” by having your game character jump and have it observe and try to deduce the association of the word jump with the action it sees your character do.
You should also give it goals - perhaps it should try and find shelter, or built some shelter.  I also suggest re-enforced learning.  In addition to verbs and nouns, learning adjectives could be done also. 
For example, teaching it the word ‘hot’ -  taking its virtual hand and momentarily placing it near the virtual fire, it would experience the discomfort, pull its hand away and you would say to it right at that time ‘HOT!’
Perhaps a test to see if it has learned the word, if it later touched something that was hot and actually stated ‘hot’, you know it had made that association.  The interesting thing will be, can you figure out a way to have it know the difference between pointing to the fire and saying ‘fire’ and putting its hand near the fire and saying ‘hot’.

 

 
  [ # 3 ]

So I heard this riddle today.  A man was on a bridge and he jumped.  The question is, where was he when he jumped?  If you say “on the bridge”, that was before he jumped.  If you say “in the air”, that was after he jumped.  If we have this kind of problem with a verb like jump, how is a computer supposed to “get it”? 

When I tell my dog to “sit”, it is more like assume the position than like performing the act.  Still the dog does know how to “roll over” which is more going through the motions than ending up where he started.  Could you train your bot like we train animals?  I guess you’d have to at least build in a rewards system to encourage your bot to do the right thing.  I think that might be better than a bunch of uncomfortable states like burning your hand to learn “hot”.

Oh, BTW, did you know that Microsoft is giving away for free its Robotics SDK which has a real world simulation including all the physics like one might find in a video game?  This way you can focus on what the bot is doing instead of the mechanics of making the bot do the things.

 

 
  [ # 4 ]
Gary Dubuque - May 29, 2010:

I think that might be better than a bunch of uncomfortable states like burning your hand to learn “hot”.

I disagree, since the bot needs states, it needs both ‘comfortable’ and ‘uncomfortable’ states in order to have goals.  One goal all humans share, in general, is to seek comfortable states and avoid uncomfortable ones.  It will be limited in learning and understanding if it were not to have uncomfortable ones.

  As for the riddle, in ordinary human conversation we make assumptions, and then ask questions as we learn more details.    Most people wouldn’t say you’re not on earth for the brief moment you are in mid air while jumping.  With human conversation we make approximations, and ‘riddles’ can be ignored - we simply employ common sense in most conversations.  I don’t think we have to worry about asking ‘Was that before, or during the time he was jumping?’ in response to being asked “Where was the man when he jumped.”  I highly doubt a program would fail the Turing test if it simply responded with the common sense answer ‘on the bridge’.

Now it will take a highly intelligent system to actually be able to cope with the following:


User : A man was on a bridge and he jumped.
User: Where was the man.
Computer: on the bridge (common sense response)
User: Are you sure? After all, WHILE he was in the air, he wasn’t technically on the bridge.
Computer: hum… I *suppose* you have a point.

If the system actually understood your point, that would be one advanced bot.  But I think most people would be happy with the initial assumption and response ‘on the bridge’.

The assumption you made about the man being in the air AFTER he jumped isn’t quite right either - after he jumped he landed, we assume on the bridge—or perhaps he jumped OFF the bridge and into the water, committing suicide.  Actually, that would be the assumption that would make sense, since in normal situations a person just doesn’t stand on a bridge and jump up and down.  If we didn’t make any assumptions, we would have to ask the clarifying question, ‘Well, do you mean, before, during, or after he landed?’  And then you still don’t know and have to make an assumption as to whether he intended on ending his life OFF the bridge or just wanted to be silly and jump for no reason.  Also, if we talk about where he was AFTER he jumped, there could be tens of thousands of answers—all the different places he was after that until his death !!  Also, the assumption and response ‘on the bridge’ is correct and is not negated by the fact that he could have been other places before and after.


The point I’m making is we have to at least assume the most likely, or the most probable or reasonable response based on assumptions that exist most of the time - and have the ability to understand if the user comes back with a type of ‘Are you sure because…....’  type of riddle.
Otherwise we would be faced with asking dozens of questions for every single statement.  Humans don’t do this, we assume things that are true most of the time, unless we are told further into the conversation.

If I tell the bot my brother is coming to visit, and it knows he has a car, and my brother lives 300 miles away, and it already knows he drove every other time he came to visit, it will assume he is driving.  That’s a safe assumption, I don’t want my bot to ask ‘Is he driving’ each time, that’s ridiculous.  Now if I just told my bot that my brother’s car is in the shop being repaired, then it could ask, ‘How is he getting there?’

 

 
  [ # 5 ]

Hey everyone,
I am new in this area of chatbots.
I mostly work in robotics, but recently i thought that the future is combining chatbot technologies with current robotics.
So, i started developing my first chatbot.
My first approach was AIML, but really soon i realized that there is no freedom of describing the world and having a general idea of the real world, just like Chuck proposes.
My second idea was based on semantics.
Semantic web has several interesting features and if we could use owl and rdf, instead of aiml the results would be really beneficial.
Now, i am in the stage of designing the whole idea but i would really like to listen your experiences and propably give some guidance.
Thank you very much and good luck with your projects :D

 

 
  [ # 6 ]

To Victor,

Assumptions is a powerful tool.

I’ve read that in the past computer programs demonstrated story understanding by internally asking to themselves the questions one might use to verify that the program really understood the story.  In answering these questions, the program makes a bunch of propositions that stay in effect until later in the story they are contradicted.  One path to understanding was to create explanation plans that contain both the questions (or constraints) and the possible answer. A library of these plans or combinations of the plans) would be tried for the best fit.

To Michael,

Take a look at AIMLpad.  It has some of the things you are thinking about and it is open source.

 

 
  [ # 7 ]
Gary Dubuque - May 29, 2010:

To Michael,

Take a look at AIMLpad.  It has some of the things you are thinking about and it is open source.

Thank you very much Gary, but the think is that i have already tried aiml and it is not so flexible!
I am looking for something that can be generalized, into describing something more abstract..
Semantic web technologies look very promising, but i still do not know.
A chatbot using aiml or something similar will be always finite.
But semantic web uses a logic that is very rich and the complexity is very high!!
I do not know if this is good (  i guess not ),but still our robots will be less predictable.
So, any good ideas to start with?

 

 
  [ # 8 ]

Perhaps I didn’t explain AIMLpad enough.  It has an object oriented representation with multiple inheritance of the values used in the sets and gets of AIML.  That representation is a frame system with demons on actions like insert or update. The value slots have facets for confidence factor, date/time, english translation, etc. The slots can also be triples as used by the semantic network. There is a library extracted from OpenMind of around 300,000 triples.  It also has built-in communication to OpenCyc for around a million assertations. All this is controlled through a context-free scripting language that does sequential processing. It utilizes WordNet 2.1 for a dictionary of 160,000 words. It has both forwards and backwards chaining expert system shell that can use fuzzy logic. It has a general purpose planner. So although you could use AIML to do a primative parse on user input, you also could connect to ConceptNet 2.1 to parse the input (with montylingua) using an AIMLpad script command. Or you can just use the regular expressions that typically are used to normalize the input. You can project the frames into beliefs and try theories adopting those that satisfy your method of thinking. It also uses an in-memory sql database, so if you’ve got the triples (rdf) converted to a table, you’ve got that traditional powerhouse to process the details.  It can call out to internet sites to pull the data directly.  It also has an RSS script command. In classic AI, the stuff I’m missing is neural networks, genectics, and statistics like the use of Markov chains. So while it might not be the tool you end up with for your bot, it is a starting place to try some of the ideas you have.  It is not just AIML. BTW, I just spent several months writing the on-line help. http://www.aimlpad.com

 

 
  [ # 9 ]
Gary Dubuque - May 30, 2010:

Perhaps I didn’t explain AIMLpad enough.  It has an object oriented representation with multiple inheritance of the values used in the sets and gets of AIML.  That representation is a frame system with demons on actions like insert or update. The value slots have facets for confidence factor, date/time, english translation, etc. The slots can also be triples as used by the semantic network. There is a library extracted from OpenMind of around 300,000 triples.  It also has built-in communication to OpenCyc for around a million assertations. All this is controlled through a context-free scripting language that does sequential processing. It utilizes WordNet 2.1 for a dictionary of 160,000 words. It has both forwards and backwards chaining expert system shell that can use fuzzy logic. It has a general purpose planner. So although you could use AIML to do a primative parse on user input, you also could connect to ConceptNet 2.1 to parse the input (with montylingua) using an AIMLpad script command. Or you can just use the regular expressions that typically are used to normalize the input. You can project the frames into beliefs and try theories adopting those that satisfy your method of thinking. It also uses an in-memory sql database, so if you’ve got the triples (rdf) converted to a table, you’ve got that traditional powerhouse to process the details.  It can call out to internet sites to pull the data directly.  It also has an RSS script command. In classic AI, the stuff I’m missing is neural networks, genectics, and statistics like the use of Markov chains. So while it might not be the tool you end up with for your bot, it is a starting place to try some of the ideas you have.  It is not just AIML. BTW, I just spent several months writing the on-line help. http://www.aimlpad.com


I did not know that aimlpad had so many features!!
I will definetely give it a serious try, because i started reading the documentation and it seems like an easy and helpfull tool.
I do not know how to thank you enough Gary, because if it works like the way you describe it, that means that i have to focus directly on the ideas rather than the technical stuff!!!
Again,
Thank you very much and have a nice day :D

 

 
  [ # 10 ]

Hi,
My programming Saturday turned into a major garage cleaning/organizing day. However, my wife and family are much happier. My wife assures me I can program today after church. =)

@Erwin
I’ve written a lot of code to harvest data from the web…however I’ve never actually tweeted with code.  That’s an interesting idea…and maybe something I can add up front in development.  I’ll google that later.

@Victor,
I hadn’t thought of inserting myself as an avatar…although I should since that movie was a big success with my family members. However, I do intend to have a ‘god’ mode…which would allow me to alter world mechanics such as temperature, wind speed and direction, rain, insertion of various animals, etc.

I’m not certain that I want to build a bot that must be trained to jump, eat, run, etc.  I would be more interested in creating a bot that has already acquired basic psychomotor skills…and the ability to relate to them. However, I do need to give consideration and design a bot that can ‘learn’ things that I have not deliberately set about teaching him.

Grammer?  I’ll give that some thought.

@Gary,
Training like an animal?  I suppose animals and infant humans are trained in a similar manner…I hadn’t really likened a human bot being training like an animal. I could make him Tarzan…and have to ‘untrain’ him from acting like an animal. =)  Stimulus response, rewards, trying to impress others, stubborn willpower…all of these will play some role.  I do need to spend more time on that design.

AIMLpad…sounds interesting.

@Michael,
Robotics would be my preference. However, I figured if I had a sophisticated, walking, seeing, sensing machine in my living room…it would still need code. That’s where the real work lies.  Microsoft SDK was a good suggestion. I’m not sure what scripting language(s) they support in making your robot operate.

@All,
Obviously the underlying code structure must be advanced…however, I’m going to start easy and begin coding the world system. I want a command language to allow me to modify the environment at the prompt.  I need to work on the multithreading support as well as some code to synchronize the various bits.

I hope to post something along with a detailed spec of this portion before the long weekend is up.

Regards,
Chuck

 

 
  [ # 11 ]

Chuck - I’m getting a big kick out of your comments - I know the challenge of managing work time, around the house work time, and chatbot work time!!  I told my wife about your comment about giving your bot a male name so your wife wouldn’t be jealous, she thought it was extremely funny.  Keep the humour coming!

Yes, for your bot I don’t recommend my approach - it is on the other end of the spectrum.  Your approach involves more training I think, lower level.  My bot will not learn meanings of words, it will be hand coded.  Also I will manually enter all grammer rules.  Where I will leave off and it will take over is determining the meaning of sentence based on a) already known word definitions and b) rules of grammar.

Gary - thanks for that excellent feedback - is there any demos online perhaps that have this story understanding ability?  Does the system understand natural language or does it perhaps have to be first ‘coded’ in propositional logic or something ?

 

 
  [ # 12 ]

Hey Gary, very cool!

If I throw you a ball, and you did not miss it, did you catch it?

How?

The ball would have to first reach a half way point between you and I.

and then from that half way point, reach a half way point between the

previous half way point and you, and then from that half way point, reach a half way point between the previous half way point and you, and then from that half way point, reach a half way point between the previous half way point and you, and then from that half way point, reach a half way point between the previous half way point and you,  And so on…

In theory the ball never reaches you.

 

Nonetheless, that was a very cool thing to post about the bridge.

 

8-Man

 

 
  [ # 13 ]

The AIMLpad tool is quite powerful.

 

 
  [ # 14 ]

@Gary. A SEO tip from Erwin:
aimlpad.com is now redirecting to
http://216.128.99.72/AIMLpad/
If you do it the other way around, using aimlpad.com, this URL will be listed on #1 in Google on ‘AIML Pad’

just as a side note….

 

 
  [ # 15 ]

Hi,
I’ve gotten several hours yesterday and today coding the framework of this project. I must admit that programming multi-threading in C++ is not intuitive and has consumed most of my time so far. =)

The various threads I intend to add so far are:

* Virtual bot - senses, simulated body movements, will, etc.
* Thinking - this bit reflects what bot is thinking
* Chatting - responding to the human conversation, phrasing verbal expressions
* World - manages the world and all that is in it.
* System -main thread manages user input, display, tweets (if I learn how to do this), etc.

The various threads draw from a common set of databases and will require sychronization.

That’s about it. 

Regards,
Chuck

 

 1 2 3 >  Last ›
1 of 22
 
  login or register to react