0

So I wanted to create a chatbot using python and i am , I tried this code

this is a screenshot of the code and the problem:

this is a screenshot of the code and the problem

...But I'm always having this Warning and I Don't Know Why : WARNING: No match found for input: LOAD AIML B

Reegan Miranda
  • 2,879
  • 6
  • 43
  • 55
  • 2
    Please include the code and error in the post itself as a code block, not as a screenshot. See the posting guidelines https://stackoverflow.com/help/how-to-ask. – Musab Guma'a Jul 08 '20 at 17:32
  • I see you named your file `aiml.py` and are importing a module of the same name which should mean I'd expect you to run into [this problem](https://stackoverflow.com/questions/36250353/importing-installed-package-from-script-raises-attributeerror-module-has-no-at) but you don't which is weird. Just be aware of that in case it comes up. – Tadhg McDonald-Jensen Jul 08 '20 at 18:50
  • which pip package you're using for `aiml`? there are a couple of them out there – Mrinal Roy Jul 08 '20 at 19:37

1 Answers1

2

You need to have botdata\standard in the same path as you run in your Python script.

I suggest you use python-aiml as it's most updated. The old PyAIML was last updated around 10 years ago, link to Github. Steps below assuming you're a Windows user and have Anaconda environments enabled.

  1. Install pip install python-aiml
  2. Copy files from C:\Users\your-username\Anaconda3\envs\env-name\Lib\site-packages\aiml\botdata\standard and create a standard folder in your Python script's root and paste all those files.

The code you need:

import aiml
k = aiml.Kernel()
k.learn("startup.xml")
k.respond("LOAD AIML B")
while True:
    k.respond(input("Enter your message: "))
  1. Otherwise just cd to that aiml package location and keep your python script there. The screenshot below on how I loaded in my terminal and working proof.

python-aiml in action

It's working

Mrinal Roy
  • 969
  • 7
  • 12