{"id":23922598,"url":"https://github.com/datenhahn/python-aiml-chatbot","last_synced_at":"2025-09-07T04:34:05.839Z","repository":{"id":215468869,"uuid":"102524435","full_name":"datenhahn/python-aiml-chatbot","owner":"datenhahn","description":"Simplest chatbot in python, comes with ALICE 1.9 minimally modified AIML starter set","archived":false,"fork":false,"pushed_at":"2017-09-05T20:02:11.000Z","size":1582,"stargazers_count":46,"open_issues_count":1,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-23T00:07:26.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datenhahn.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-09-05T20:01:12.000Z","updated_at":"2024-07-29T21:05:45.000Z","dependencies_parsed_at":"2024-01-04T16:44:01.888Z","dependency_job_id":null,"html_url":"https://github.com/datenhahn/python-aiml-chatbot","commit_stats":null,"previous_names":["datenhahn/python-aiml-chatbot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datenhahn/python-aiml-chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fpython-aiml-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fpython-aiml-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fpython-aiml-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fpython-aiml-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datenhahn","download_url":"https://codeload.github.com/datenhahn/python-aiml-chatbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datenhahn%2Fpython-aiml-chatbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273996962,"owners_count":25204473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-05T17:15:09.910Z","updated_at":"2025-09-07T04:34:05.819Z","avatar_url":"https://github.com/datenhahn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Some while ago I wrote a short tutorial about how to create an AIML chatbot and output its text\nvia espeak (https://iniy.org/?p=68).\n\nAFter years I stumbled over this post again and now here is a second part which loads the AI Foundation's A.L.I.C.E.\nAIML from http://www.alicebot.org/aiml.html .\n\nTo be honest I was a bit surprised about how little and hard to find documentation there is on the\nnet to get this simple aiml files to run. There is a bit hard to find google code page:\nhttps://code.google.com/archive/p/aiml-en-us-foundation-alice/\n\nBut the AIML is optimized for the Pandorabots online plattform and I wanted just to play around\na bit with this stuff locally.\n\nSo here is a repository with batteries included:\n\n- Based on aiml-en-us-foundation-alice-1.9 zip file from the AI Foundation google code website\n- removed Pandorabots specific syntax\n- added std-startup.aiml with the (I think) correct load-order of the aiml files\n- minimal version of a python chatbot\n\n## Setup\n\nRequires python3 (but porting this minimal script to python 2 is very easy)\n\n\n    pip3 install python-aiml\n\nThen just run\n\n    ./chatbot.py\n    \n## Where to go from here\n\nThis minimal script doesn't implement a preprocessor and due to the removal of some pandorabots\nspecial syntax it might give some odd answers, but it is a starting point.\n\nAdd your own AIML files at the bottom of the std-startup.aiml (so they have highest priority)\nand play around making the bot smarter.\n\nIncluding the espeak output from my other blog post also might be fun (https://iniy.org/?p=68).\n\n## General Documentation (from AI Foundation google code website)\n\nAs I had a hard time finding the loading order information I include this here in the repo.\n\n\n### Using the A.L.I.C.E. AIML files\n\nThe aiml-en-us-foundation-alice files contain a number of categories with duplicate patterns. Depending on the AIML interpreter used, duplicates are handled differently.\n\nOn Pandorabots the rule is: The files are loaded in order from the top of the list (under the \"AIML Files\" section) to the bottom. When a category is loaded that has the same pattern path (i.e. same input pattern, that pattern and topic pattern--remember that \u003cthat\u003e and \u003ctopic\u003e are set to implicitly), then Pandorabots discards the earlier category and selects the response template from the most recently loaded category.\n\nTo give an example: Suppose a file A.aiml has a category \u003ccategory\u003e \u003cpattern\u003eTEST\u003c/pattern\u003e \u003ctemplate\u003eThis is the response from file A.\u003c/template\u003e \u003c/category\u003e and a file B.aiml has a category \u003ccategory\u003e \u003cpattern\u003eTEST\u003c/pattern\u003e \u003ctemplate\u003eThis is the response from file B.\u003c/template\u003e \u003c/category\u003e\n\nProvided that the files are loaded in alphabetical order, the A.aiml loaded before the B.aiml, then the response to the input \"Test\" should be \"This is the response from file B.\"\nA.L.I.C.E. AIML File Order\n\nThe A.L.I.C.E. AIML files in aiml-en-us-foundation-alice should be loaded in the following order:\n\n- First load the Safe reduction files reducation0.safe.aiml,...,reduction4.safe.aiml and reductions.update.aiml.\n- Second, load the Mindpixel files mp0.aiml,...,mp6.aiml.\n- Then load all remaining AIML files.\n- Pandorabots will always load the file update.aiml as the last file.\n\n### AIML utilizes a preprocessing step called Normalization.\n\nThis AIML set is designed to work with the default AIML preprocessor supplied with Pandorabots.com.\n\n    The preprocessor\n\n    Corrects some spelling errors and colloquialisms (e.g. \"wanna\" --\u003e \"want to\")\n    Substitutes words for common emoticons (e.g. \":-)\" --\u003e \"SMILE\")\n    Expands contractions (e.g. \"isn't\" --\u003e \"is not\")\n    Removes intra-sentence punctuation (e.g. \"Dr. Wallace lives on St. John St. --\u003e \"Dr Wallace lives on St John St.\")\n\nWe refer to the above substitution steps as Normalization.\n\nThe last preprocessing step\n\n    Splits sentences based on predefined punctuation characters \".\", \"!\", \";\" and \"?\"\n\nAll of these preprocessing steps are defined in the configuration file. In addition the configuration file\n\n    Defines substitutions for \u003cgender\u003e, \u003cperson\u003e and \u003cperson2\u003e\n\nThe preprocessor normalizes the inputs to the bot by running through a series of substitutions, then splits the input into sentences and feeds these one at a time to the bot.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatenhahn%2Fpython-aiml-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatenhahn%2Fpython-aiml-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatenhahn%2Fpython-aiml-chatbot/lists"}