eliza.py, ELIZA in Python

This is a little version of ELIZA, a famous natural-language AI demo from the 1960s, packaged up as a Python module. It's all smoke and mirrors; the program doesn't have a clue what it is saying and it's not difficult to catch it out. It's amusing, and it means your chatbot always has something to say.

I adapted Joe Strout's original implementation for Python 2 and packaged it as a module. He's given me his permission to release it.

The eliza.py module includes an interactive mode, so you can get a feel for how it performs. Simply unpack the download and python eliza.py. To use the it from with in your own script do something like

import eliza

therapist = eliza.eliza()

while(some_condition)
  #get input from somewhere
  reply = therapist.respond(input)
  #send reply somewhere

Download

eliza.py-0.2.tar.gz (3705 bytes)
eliza.py-0.2.zip (3866 bytes)
These packages were uploaded on 28 February 2005.

Talk to Eliza

If you have Yahoo Messenger, you can talk to it here

References

J. Weizenbaum, ELIZA - A Computer Program For the Study of Natural Language Communication Between Man And Machine Communications of the ACM, Vol 9, No 1, January 1966


[Add a comment]

Jez Higgins