Friday, 10 July 2015

A CHATTER-BOT PHILOSOPHY

“can computers think?

The answer to this very question depends on how you interpret it, and to me answer to this question explains what type of thinker are you fundamentally.
A superficial one
Or One with practical approach


Pretty philosophical right?
Objective:
Building an intelligent chatterbot.

How it Works:
First looking at how it works fundamentally …
Chatterbot is something that is able to “Chat” to you endlessly without getting bored. Obviously computers tend to be the only thing with the ‘never getting bored EVER!’ capability. So we got to build a computer program for that. And here I’m going to put forward my thought on building one with code examples in python.
Basically the application works as:
Bot says something.
User replies to it
Bot answers that
User replies
Repeat!
Using basic statements we can build a structure for that.
print "question?"
answer = raw_input()

Above stated code just prints a string that is actually a question in a natural language , in this case English (natural languages are languages that humans speak, languages we built for computers are formal languages e.g PHP ,C++ or python itself!) and takes an input from the user through raw_input() and stores it in a variable ‘answer’.
But that’s very short piece of conversation and our bot doesn’t answer so let’s try make it an answering one

print "question?"
answer = raw_input()
print "comment on answer"

fair enough!
Similar structure but it should answer based on user’s input. That’d make it a better bot right?  So choice making in it would require if , elif , else conditionals in the code.
And some “or”s or many “or”s though.
Here it’d look something like this


print "question?"
answer = raw_input()
if answer == " this ":
    print " this stuff"
elif answer == "this second possibility of stuff that user might enter":
    print "bot's second answer"
elif answer == "this thing" or answer == "this thong maybe":
    print "bot's answer any of both statements"
else:
    print "bot too smart to understand ur dumb crap loool"


you get the basic idea for it that is , asking for user’s input and making intelligent choices from the answers that the programmer already put into the programmed database thus making the bot seem Intelligent and that it “thinks”
In order to build an intelligent bot we need to think like a bot.
Such as consider yourself a chatter bot and you have to chat to a person who speaks Chinese, you don’t recognize Chinese alphabet or anything but you’re given a set of words\sentences\ questions written in Chinese and some possible responses to them.
Every time a user enters something all you (as a chatterbot) do is to match his words from the stuff that you’re given and respond in the way it is directed to you
And that’s pretty much it!
And in order to make you a better chatterbot your programmer needs to provide you with more and more Question\statement possibilities that user might enter and obviously answers to those as well.
Conclusion that’s derived here is


“MORE THE DATABASE BETTER THE BOT”
(Betterment here also refers to the extent to which it resembles a human  i.e. giving right answers and keeping up with the subject as a human would )
Here im gonna elaborate what I mean by “MORE THE DATABASE BETTER THE BOT”
To make the bot fundamentally better we need to look at a small chunk of (possible) conversation between bot and human and improve it by thinking of questions which can be thrown at a bot (who doesn’t recognize alphabet but the notion of strings) by the user (who is FAAR more intelligent than the bot and has great understanding of that specified natural language ).
And there are numerous possible ways the user can enter the easiest question\comment with words that are different yet equivalent in meanings .
Lets take a super simple chat chunk where bot asks user’s name , user replies and bot makes a comment based on user’s input .
Possibilities for the user input are endless

Bot:stare your name!

possibility 1: AARON ( user just enters his name)
possibility 2 : my name is aaron ( user enters name along with some other words, bot needs to recognise which one of them is the user's name)
possibility 3: What's your name? (user instead asks the bot something)
 possibility 4 : Why so curious? (user hold up an argument like a human would)

so on so forth..


.My target here is not to actually state ALL the possibilities but to give you the idea that what can happen.
Actually if you think about it , it is what you yourself do as well while tackling some input (question asked by someone etc) but you are very used to it that you don’t realize you do it while you do it.
You don’t realize that your brain has those endless patterns for statements and questions and enormous amount of vocabulary as well .that is actually the “DATABASE” you have , but think about how well you will perform in the scenario of you chatting to someone Chinese.youll definitely not do so well .But you can do well on that if you’re give these two things
Endless amount of data base
Super fast speed to match the patterns.

Computers have that !!!
But the most fascinating thing here is  our brains have them both even if we don’t realize it.also to consider the fact that natural languages have taken eons and eons of time to evolve into the way they are right now and they are still evolving i.e. database is still adding . human level provided the speed and database . Which requires a lot of time to add in the directory of the program.
Thus in conclusion , in my opinion Yes it is possible for a computer program (chatterbot) to reach


[p.s I know better scripting is possible by the use of lists and word search thingys  and loops and everything maybe using AIML but my target is about the theoretical thinking related to making a chatterbot not actually writing the formulas here thanks !]

No comments:

Post a Comment