Creating a personality: chatterbots

This part is actually very easy – there is a fantastic API already available that does the job. Use this API and then all that needs to be done for the AI program is creating a function that feeds in the query to the robot and gets the response:

from chatterbotapi import ChatterBotFactory, ChatterBotType

def getAIresponse2(s):
	factory = ChatterBotFactory()
	bot2 = factory.create(ChatterBotType.CLEVERBOT)
	bot2session = bot2.create_session()
	response = bot2session.think(s)
	return response

In this example I use CLEVERBOT but there are certainly other bots to choose from. A little later I will talk about the predicament to develop a personalized chatterbot baesd on chat histories.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: