micropython-eliza


Namemicropython-eliza JSON
Version 0.1.1 PyPI version JSON
download
home_page
SummaryELIZA chatbot for MicroPython. Based on 'ELIZA' by Joseph Weizenbaum, 1966.
upload_time2023-11-02 09:23:38
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords eliza ai chatbot micropython nlp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

## Reference

"ELIZA - A Computer Program For the Study of Natural Language Communication Between Man and Machine" by Joseph Weizenbaum, 1966.

DOI: [10.1145/365153.365168](https://doi.org/10.1145/365153.365168)
S2CID: [1896290](https://www.semanticscholar.org/paper/1896290)

## Example conversation

```
ELIZA: DO COMPUTER WORRY YOU
CLIENT: WHAT IF THEY START TO THINK
ELIZA: DO YOU THINK ITS LIKELY THAT THEY START TO THINK
CLIENT: ARE YOU THINKING YOURSELF
ELIZA: WHY ARE YOU INTERESTED IN WHETHER I AM THINKING MYSELF OR NOT
```

## Example log with processing information

```
CLIENT: YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER
Message: 'YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'
	Text segmentation: 'YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'
	Processing sentence: 'YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'
	Tokens: 'YES', 'BUT', 'MAYBE', 'EVERYONE', 'HAS', 'PROBLEMS', 'EVEN', 'A', 'COMPUTER'
	Keystack (detected keywords): 'COMPUTER' (rank: 50), 'EVERYONE' (rank: 2), 'YES' (rank: 0), 'MAYBE' (rank: 0)
	Altered sentence: ' YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'
	Processing rules associated with keyword: 'COMPUTER'
		No decomposition defined for rule (use top answer)
	Found response for keyword: 'COMPUTER' (ignoring remaining keywords)
Response: DO COMPUTER WORRY YOU
ELIZA: DO COMPUTER WORRY YOU
```

## 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)
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "micropython-eliza",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "ELIZA,ai,chatbot,micropython,nlp",
    "author": "",
    "author_email": "Szymon Jessa <szymon.coding@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/11/fe/0af549bd1eeb2fae0478e51cb53cb85176f8cb8aad724f810fe71689275b/micropython_eliza-0.1.1.tar.gz",
    "platform": null,
    "description": "# ELIZA for MicroPython\n\nELIZA 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.\n\n## Reference\n\n\"ELIZA - A Computer Program For the Study of Natural Language Communication Between Man and Machine\" by Joseph Weizenbaum, 1966.\n\nDOI: [10.1145/365153.365168](https://doi.org/10.1145/365153.365168)\nS2CID: [1896290](https://www.semanticscholar.org/paper/1896290)\n\n## Example conversation\n\n```\nELIZA: DO COMPUTER WORRY YOU\nCLIENT: WHAT IF THEY START TO THINK\nELIZA: DO YOU THINK ITS LIKELY THAT THEY START TO THINK\nCLIENT: ARE YOU THINKING YOURSELF\nELIZA: WHY ARE YOU INTERESTED IN WHETHER I AM THINKING MYSELF OR NOT\n```\n\n## Example log with processing information\n\n```\nCLIENT: YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER\nMessage: 'YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'\n\tText segmentation: 'YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'\n\tProcessing sentence: 'YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'\n\tTokens: 'YES', 'BUT', 'MAYBE', 'EVERYONE', 'HAS', 'PROBLEMS', 'EVEN', 'A', 'COMPUTER'\n\tKeystack (detected keywords): 'COMPUTER' (rank: 50), 'EVERYONE' (rank: 2), 'YES' (rank: 0), 'MAYBE' (rank: 0)\n\tAltered sentence: ' YES BUT MAYBE EVERYONE HAS PROBLEMS EVEN A COMPUTER'\n\tProcessing rules associated with keyword: 'COMPUTER'\n\t\tNo decomposition defined for rule (use top answer)\n\tFound response for keyword: 'COMPUTER' (ignoring remaining keywords)\nResponse: DO COMPUTER WORRY YOU\nELIZA: DO COMPUTER WORRY YOU\n```\n\n## How to install\n\n```\npython -m pip install --upgrade micropython_eliza\n```\n\n## How to run\n\nStart chat in the console:\n```\npython -m micropython_eliza.chat\n```\n\nSee an example conversation:\n```\npython -m micropython_eliza.demo\n```\n\n## How to use\n\n```\nimport sys\nfrom micropython_eliza import eliza\n\nUSERNAME_IN_CHAT = \"YOU\"\n\nagent = eliza.create()\nprint(\"\\n<press enter with no message to exit>\")\nprint(f\"{agent.name()}: {agent('')}\")\nprint(f\"{USERNAME_IN_CHAT}: \")\nmsg = sys.stdin.readline().strip()\nwhile msg:\n    print(f\"{agent.name()}: {agent(msg)}\")\n    print(f\"{USERNAME_IN_CHAT}: \")\n    msg = sys.stdin.readline().strip()\n```\n\nTo enable printing info and debug messages, provide log handlers, e.g.:\n```\nagent = eliza.create(log_info=print, log_debug=print)\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "ELIZA chatbot for MicroPython. Based on 'ELIZA' by Joseph Weizenbaum, 1966.",
    "version": "0.1.1",
    "project_urls": {
        "Demo": "https://www.szymonjessa.com/eliza",
        "GitHub": "https://github.com/denise-pl/micropython-ELIZA"
    },
    "split_keywords": [
        "eliza",
        "ai",
        "chatbot",
        "micropython",
        "nlp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b32093f977f271e4a77ecf24e93b32ab786dadb9cfa9132bca0738d9f92f82c1",
                "md5": "fe0ecd253a20ead8a8a9caa3a9dd019a",
                "sha256": "af98048864e0a176ca74d3260bc03201a775c630967ad747132bc96d60f22e54"
            },
            "downloads": -1,
            "filename": "micropython_eliza-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe0ecd253a20ead8a8a9caa3a9dd019a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16440,
            "upload_time": "2023-11-02T09:23:36",
            "upload_time_iso_8601": "2023-11-02T09:23:36.822931Z",
            "url": "https://files.pythonhosted.org/packages/b3/20/93f977f271e4a77ecf24e93b32ab786dadb9cfa9132bca0738d9f92f82c1/micropython_eliza-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11fe0af549bd1eeb2fae0478e51cb53cb85176f8cb8aad724f810fe71689275b",
                "md5": "114773ead9ff79f404d03bcfc2d65447",
                "sha256": "6693290a33b4124f0f0047a91ca0e88c14c11fd7d50eea9476873629c6e165a6"
            },
            "downloads": -1,
            "filename": "micropython_eliza-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "114773ead9ff79f404d03bcfc2d65447",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14669,
            "upload_time": "2023-11-02T09:23:38",
            "upload_time_iso_8601": "2023-11-02T09:23:38.330483Z",
            "url": "https://files.pythonhosted.org/packages/11/fe/0af549bd1eeb2fae0478e51cb53cb85176f8cb8aad724f810fe71689275b/micropython_eliza-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-02 09:23:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "denise-pl",
    "github_project": "micropython-ELIZA",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "micropython-eliza"
}
        
Elapsed time: 2.59472s