Of course, what is the first thing everybody wants to do? Make Cleverbot talk to itself!
With the module, coding is quite simple. The version I’m running outputs the code to an html page on my server, but the syntax was screwing up in WordPress, so I’ve left that out.
import cleverbot # beginning two different cleverbot sessions # I use steve and bob to keep things separate while coding. # This is not reflected in the html output. steve = cleverbot.Session() bob = cleverbot.Session() # Gathering info....boring stuff convo_start = raw_input("How would you like to begin the conversation? : ") print "" cycles = int(raw_input("How many cycles would you like to run? : ")) print "" # Starting the conversation print "Bob: "+convo_start reply = steve.Ask(convo_start) print "Steve: "+reply i = 0 # continuing the conversation in the loop. while (i <= cycles): # you will have to edit the less than symbol on this line. reply = bob.Ask(reply) print "Bob: "+reply reply = steve.Ask(reply) print "Steve: "+reply i = i + 1 # ....and now to tie up my loose ends. exit()
The output is definitely interesting. At one point, I grabbed text from the website’s “Think For Me” as a true study of what this would yield. At one point, they started quoting the song “Still Alive” from Portal!
I’ve also found that this bot seems loop resistant. I groaned when I saw “Yes you did!; No I didn’t!” cycle about 3 times, but the bot actually recovered. I’m actually surprised that the bot seems to be great at bringing up it’s own subjects too.
Then every once in a while, the bot will give me a facepalm moment of just utter stupidity. I’ve learned that as soon as one of them announces that they are Cleverbot that I should just ignore the next 10 lines. Regardless, I accomplished what I wanted to, and I can live with that.
Now for some examples!
I’d be more than happy to start the script with any examples given to me, just let me know!