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

questions about getting started
 
 

i’m looking to make a chatbot in python and not for any functional purpose like a virtual assistant, but just to see how much the bot is able to learn based on its interactions with people. the problem is, most guides seemed to be directed at people who actually want to make useful bots that respond to certain questions with a predefined answer.

i’d like to clarify i’m not expecting anything fancy like a bot that can communicate coherently based on this, i’m just interested to see how much it’s capable of learning based on certain methods, similar to http://projectbot13.tumblr.com/ but using different methods of learning

how would i go about creating a bot that learns in this manner? if python isnt the best to use for this, i don’t mind learning something else. this is just a hobby project and not anything that’s on a schedule so if i need to take more time to put extra work into it that’s not a problem.

 

 
  [ # 1 ]

There are a number of approaches to this and the one you choose will depend on how far down the rabbit hole you are willing to go. Choosing which language to use will the be least of your worries unless you are very inexperienced with programming in which case Python is an excellent choice.

If you use chatbot scripting languages like AIML or ChatScript you will obtain very entertaining results quite quickly but they are quite superficial. You won’t be able to implement any form of learning more advanced than simple parroting of facts without more sophisticated methods of programming.

Beyond that, things start to get complicated very quickly. At the very least you will have to decide between stochastic (statistical) and deterministic (rule based) learning methodologies. A good place to start learning about the latter is http://www.ontologyportal.org which is all about common sense reasoning and first order logic, and a good example of the former is http://rtw.ml.cmu.edu/rtw/ which is a computer program that has been reading and learning from the internet for years.

 

 
  [ # 2 ]

I hear Python is good for experimenting, I’d say it’s a good choice. There were a few posts about machine learning applied to dialog recently on the forum, you might look those up. Other keywords are Natural Language Processing (NLP) and you might want to give neural nets a try (just don’t ask me how to program one, I have no idea). You’ll probably want to set up your project online to have access to a large number of people, i.e., dialog inputs that the chatbot can learn from. Alternatively, people have tried having their AI read movie scripts or novels, which, usually, they learn to repeat.

While it’s not my field of expertise, most attempts at learning dialog automatically seem to go with partial sentence matching. Cleverbot is such a case (and pretty bad, I have to note), that memorises question-answer pairs that people say consequtively, then remembers that e.g. the answer “yes” once coincided with the question words “Are”, “you”, “a” and “human”. Then next time someone asks a question with the words “You”, “are” and “a”, there is a probability of 3 words that the answer “yes” is appropriate. Check the same for all other question-answer pairs and the chatbot would come up with the statistically most probable answer. That’s one way to go about it. You can increase the probability for words that are in the same order, the amount of words that match consequtively, take previous sentences into account as well, etc. More advanced methods involve “word vectors”, but I’m not familiar with those myself. They’re used in document summarisation to extract the topics of a document. Sounds like it could apply to conversation as well.

 

 
  login or register to react