Simple interpreter for AIML 2.1
Project description
pyaiml21
AIML [^AIML] 2.1 Chatbot Design Language Interpreter in Python 3.
The AIML language is a (simple) XML-derived language for description of chatbots and the communication with the user based on the pattern-matching the user's query and evaluating (human-coded) response.
pyaiml21 is an AIML interpreter, supporting the latest AIML specification. It was created as a bachelor thesis and should be fully compatible with its predecessor, PyAiml [^pyaiml].
Installation
Install the project from PYPI:
$ python -m pip install pyaiml21
Quick Example
This example demonstrates how to quickly set-up and run a basic chatbot with publicly available source files from ALICE [^ALICE].
Running via console script
pyaiml21 comes with a simple script to run your chatbots, if you unpacked
the contents of your bot into alice/ folder (so that the structure
is alice/aiml/.., alice/aimlif/.., alice/sets/.. ..), then running
the following will start your bot:
$ aiml --bot alice
Running from Python
It is still possible to start your bot directly from python[^example], e.g.
>>> from pyaiml21 import Bot
>>> my_bot = Bot()
>>> my_bot.learn_aiml("path to .aiml file")
>>> # more loading stuff, see `pyaiml21.utils` for helpers
>>> my_bot.respond("Hello", "USER_1")
Hi! How are you doing?
For examples of simple bots, checkout /examples folder.
Motivation
This project was created to support the AIML 2.1 in Python while preserving the simplicity of user interface from pyaiml. Note that for Python, there exists an AIML interpreter, program-y [^program-y], but it does come with the full chatbot platform, the simple interface is missing.
Documentation
Please visit the official documentation.
License
MIT.
[^ALICE]: alice source code
[^AIML]: Artificial Intelligence Markup Language (Dr. Wallace, 2001); see the official specification of version 2.1
[^example]: The actual response depends on your AIML file, to load .aimlif,
substitutions.., see methods of pyaiml21.Bot
[^pyaiml]: original interpreter in python for AIML 1.0
[^program-y]: AIML Interpreter in Python3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyaiml21-1.0.1.post2.tar.gz.
File metadata
- Download URL: pyaiml21-1.0.1.post2.tar.gz
- Upload date:
- Size: 64.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f94bad63afa611f583f3b4564a28336bf71da75493ac69aae2d38d0edae23668
|
|
| MD5 |
b6312834edc4c4810680052252d5fd7e
|
|
| BLAKE2b-256 |
57f72578c556f3102d06636c91de65774e3654e0d28ddc1f948c909ef3305341
|
File details
Details for the file pyaiml21-1.0.1.post2-py3-none-any.whl.
File metadata
- Download URL: pyaiml21-1.0.1.post2-py3-none-any.whl
- Upload date:
- Size: 80.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37e70a2f23b4d53875893feae354fd41c10dd2aea9b7fe2ec2eae8298a6e3105
|
|
| MD5 |
d51b4a9dc73e5a97fb96c032e38a49d7
|
|
| BLAKE2b-256 |
e3a44280e8bf62d91426edc7e9199e64bacdc10ea1cd8b5969440cc45498bb28
|