Skip to main content

Simple interpreter for AIML 2.1

Project description

pyaiml21

AIML[^1] 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[^2].

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[^5].

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[^3], 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 [^4], but it does come with the full chatbot platform, the simple interface is missing.

Documentation

Please visit the official documentation.

License

MIT.


[^5]: alice source code

[^1]: Artificial Intelligence Markup Language (Dr. Wallace, 2001); see the official specification of version 2.1.

[^3]: The actual response depends on your AIML file, to load .aimlif, substitutions.., see methods of pyaiml21.Bot

[^2]: original interpreter in python for AIML 1.0

[^4]: AIML Interpreter in Python3

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

pyaiml21-1.0.0rc3.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

pyaiml21-1.0.0rc3-py3-none-any.whl (80.4 kB view details)

Uploaded Python 3

File details

Details for the file pyaiml21-1.0.0rc3.tar.gz.

File metadata

  • Download URL: pyaiml21-1.0.0rc3.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.9

File hashes

Hashes for pyaiml21-1.0.0rc3.tar.gz
Algorithm Hash digest
SHA256 4b4d3a2e4829659dab29b7645d1ca263858c81ba9029d3b67573cb487978d834
MD5 c1653a8d7a9d88e5717bd01ddf9c4cde
BLAKE2b-256 4b1bdeca69d57519aabbde32e4c713f61a65d6723b87835d1e18c222cf41b5df

See more details on using hashes here.

File details

Details for the file pyaiml21-1.0.0rc3-py3-none-any.whl.

File metadata

  • Download URL: pyaiml21-1.0.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 80.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.9

File hashes

Hashes for pyaiml21-1.0.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 339b4d0e831d9d73ceec0d82a6a7e2c3ae3e29b3be86d916a39bd4bbcc20901c
MD5 bf629d0edc1fd3105c4137aeb6097de2
BLAKE2b-256 efda118b5af43656bab4d49cc5ee963449e166ab1123ec38732be887ce34da91

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