Jacie is chat robot based on AIML technolodge.
A python tool, PyAIML, is used to create the robot in the server. This project is aim to be a demo including HOW TO write a chatbot, HOW TO write a HTML client of the robot using WebSocket.
You can visit the website in freeshell.ustc.edu.cn to have look at the Jacie. Sorry to annouce that it will not work for 24 hours, the reason is:
- Jacie is just something that I'm intersting now, it's possible that it will get lost.
- The server, freeshell at ustc, is provided by LUG for the students in USTC. That means when I graduated from USTC, the server would not working any more, unless it's kept by LUG
- Actually I can buy a server myself. But I think it's not worthy.
you need run it on server to listen to the websocket request.
you need to install aiml and gevent-websocket first. I will introduce how to do it later.
to make it available, you need to install the php in your system. for example in ubuntu:
apt-get install php-cli
You can also read my introduction about the WebSocket Chatroom:link.
A review about AIML has been writen in Chinese by Junyuan Hong. You can read it in 初探AIML. The python AIML tool, PyAIML, is also introduced there.
PyAIML is a python tool for AIML. It can learn the knowledge written in AIML from files. What really interests me is that it can save the knowledge into file end with ".brn". (You can find the brn file at github:/aiml/standard.brn, it's a standard aiml provided and supported by PyAIML) And It can also save the session, which means the robot will remember the words you have told her. But this function is not supported by Jacie now.
You can visit PyAIML at sourceforge, learn more about it.
How to install it:
$ git clone git://pyaiml.git.sourceforge.net/gitroot/pyaiml/pyaiml $ cd pyaiml $ python setup.py install
you can import it in python with
import aiml. When you want to know more about the modules, please visit the sourceforge.
Since the HTML5 putted out, the websocket is available for all developers who is working on in-time-update, such as chatroom.
Although I have learned a lot from the Simple Chat Using WebSocket and PHP Socket, which is totally in php, I didn't use the php as the websocket server.
The gevent-websocket is used in the server, to work more smooth with PyAIML, since they are all python code.
You can learn more about the gevent-websocket in bitbucket, and clone it.
$ pip install gevent-websocket
The design used the Simple Chat Using WebSocket and PHP Socket's design. The js file is used.
This page is written with GitHub Markdown. Learn how to write Github Markdown, please visit GitHub Flavored Markdown.