Skip to main content

ELIZA chatbot for MicroPython. Based on 'ELIZA' by Joseph Weizenbaum, 1966.

Project description

ELIZA for MicroPython

ELIZA is a retro chatbot that simulates a psychotherapist, based on the original 'ELIZA' script created by Joseph Weizenbaum in 1966. The detailed output provides insights into the workings of this iconic dialogue system and supports learning basic natural language processing concepts.

How to install

python -m pip install --upgrade micropython_eliza

How to run

Start chat in the console:

python -m micropython_eliza.chat

See an example conversation:

python -m micropython_eliza.demo

How to use

import sys
from micropython_eliza import eliza

USERNAME_IN_CHAT = "YOU"

agent = eliza.create()
print("\n<press enter with no message to exit>")
print(f"{agent.name()}: {agent('')}")
print(f"{USERNAME_IN_CHAT}: ")
msg = sys.stdin.readline().strip()
while msg:
    print(f"{agent.name()}: {agent(msg)}")
    print(f"{USERNAME_IN_CHAT}: ")
    msg = sys.stdin.readline().strip()

To enable printing info and debug messages, provide log handlers, e.g.:

agent = eliza.create(log_info=print, log_debug=print)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micropython_eliza-0.1.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

micropython_eliza-0.1.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file micropython_eliza-0.1.0.tar.gz.

File metadata

  • Download URL: micropython_eliza-0.1.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for micropython_eliza-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d2df0ce84f08111989f324d7ac7c10cb775dc0556e789756723ea8e1b93b27c
MD5 48100ef7d9cdaf3bacc033654ef875f6
BLAKE2b-256 029247a4b171ce6ce651cbdb3972894bbf2f054d0cf9097f8abaaebdefeb261d

See more details on using hashes here.

File details

Details for the file micropython_eliza-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for micropython_eliza-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66bb7e9f9f25989cca81b47da95f1bccfffe2250dcd9a182f62aed2c39ffc474
MD5 0e1cbacd7597c8fe47f00ae6f7b0527c
BLAKE2b-256 082fea9284c6ed2a82f6c4d331ad04caedaa99fcd89007fa69dbf331713446f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page