-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maximum recursion depth exceed for "learn.aiml" examples #2
Comments
I have the same issue. But on Pandorabots.com it seems okay. They use LISP AIML parser though. |
Also ran into the same issue, but fixed it by using a .brn file instead for learning, however that also means you start off in a clean file. If that's what you wanna do then it would be your best bet. |
@cyberyu I never considered using AIML with LISP but it's seems a reasonable solution right now. @seth7743 What do you mean with .brn file? could you explain a little bit? By the way I believe @cdwfs is the creator and maintainer of the PyAIML: https://github.com/cdwfs/pyaiml Proof: http://www.alicebot.org/downloads/programs.html and this issue must be discussed under that page instead of this page: cdwfs/pyaiml#1
|
Your .brn will act as the learn.aiml file, it stores and retrieves the bot's learned responses. At least this is what I think you wish to achieve so here's a simple code snippet: You can use the kernel.setSessionData() and get as well on the .brn file |
@seth7743 Could you provide the file assigned at this line: Is that the file: https://github.com/cyface/pyaiml-test/blob/master/bot_brain.brn Could you explain the process at startup.txt? |
Yup, that's me! Glad to see the project is still alive and (allegedly) useful. Alas, I haven't written a non-trivial Python script in close to ten years, so I wouldn't expect too much active development in my fork of the repo. |
@mertyildiran The file is automatically created by this line (29) "kernel.saveBrain(bot_brain)" if it does not exist. The program is to initiate a chat, I'll start from line (13), the top is fairly simple I believe: I hope that's what you were hoping to achieve @mertyildiran @cdwfs It is (supposedly) quiet useful. Thanks for developing it! |
@seth7743 hmm, I understand thx! |
Hey @mertyildiran, sorry for the late reply. I was travelling. Anyhow, were you able to get the file working? I tried testing the learn.aiml file and I ran into the following:
My initial thoughts are that the aiml file probably had errors which I need to investigate but if you were able to get it to work with another aiml implementation then I guess there's a bug in this one. Please let me know. |
No @creatorrr. learn.aiml file is a legit AIML file.
https://en.wikipedia.org/wiki/Mitsuku It's working perfectly well with Program-O though, maybe examining Program-O's algorithm can help to resolve the issue with pyAIML. We are pretty sure that learn.aiml file is working well because in the university we made a virtual assistant that using it: https://github.com/mertyildiran/Dragonfire Video as proof: https://youtu.be/ujmRtqf2nxQ By the way don't irritate when you see "Teachable AI" term because it's the result of the stupidity of some academician. Replace "Teachable AI" with "AIML" term in your mind 😄 |
Hi @mertyildiran -- I've just come out of PyAIML retirement long enough to investigate this bug report. I think I see the problem -- the learn.aiml file includes a <learn> tag whose child is a <category> to be learned. However, as specified in the AIML 1.0.1 spec, the contents of a <learn> tag are meant to evaluate to a URI to be loaded (e.g. a URL or filename); inline AIML tags would not be valid, according to this interpretation. It looks like the specification of the <learn> tag was expanded in the AIML 2.0 working spec to allow inline AIML, and I agree that would certainly be an awesome feature. But PyAIML was very specifically written against the 1.0.1 spec. I don't have a wikidot account, but if I did I'd suggest an edit to the learn.aiml page to add a "version=2.0" to the <aiml> tag. I haven't looked at Program O, but if it processes this file correctly, it must either be targeting the 2.0 spec, or a relaxed interpretation of the 1.0.1 spec. To emulate this behavior in a 1.0.1-compliant interpreter like PyAIML, you could probably replace the inline AIML inside in the <learn> tag with a <system> tag that writes the same inline AIML to a temporary file, and then returns the name of that file. Or something like that. |
Hi @cdwfs. I'm glad you come back from the retirement. 😄 Adding Unique feature of learn.aiml is being recursive and I believe AimlParser.py is not able to parse recursively. But I'm not capable to understand or fix the issue, I'm just guessing. You @cdwfs should fix it. By the way this link of learn.aiml is WRONG and/or OUTDATED Correct link is this: http://www.square-bear.co.uk/aiml/learn.zip I forgot to mention that; on May 1st 2016, I reached out to Steve Worswick via email and this is the email dump:
|
@cdwfs and @creatorrr I also forgot to mention that or this just newly happened to me; When I try to load the learn.aiml file, it's giving me tons of
|
I wouldn't expect it to make a difference with PyAIML, which (as I said) does not support the AIML 2.0 spec. I don't even think there was a working 2.0 draft of the spec when I last worked on PyAIML. Adding the version attribute would just be a handy way to indicate that 2.0-level interpreter functionality is required to parse the file.
I assure you that AimlParser.py can definitely parse recursively; several other tags rely on this functionality. I'm virtually certain the problem is what I described above. See the _processLearn() function in Kernel.py, which is called when a <learn> element is encountered: it evaluates the element, treats the result as a filename, and attempts to load and learn() the contents of that file. This the behavior dictated in the 1.0.1 AIML spec, and there's no way it could possibly handle inline AIML correctly. I can't explain why it's failing the way it is, but I don't think the problem is with PyAIML; the problem is feeding (valid) 2.0 AIML data into a (valid) 1.0.1-level interpreter.
While I truly appreciate the continued interest in PyAIML, the fact is that I haven't worked on it in nearly ten years; while nothing is certain, I wouldn't count on any further updates from my end. But consider this: it was the first non-trivial Python project I wrote. With a bit of effort, it wouldn't take you long at all to learn as much Python as I knew when I wrote PyAIML! |
@cdwfs OK. I will try to upgrade PyAIML to AIML 2.0 in near future. It would be much easier for you to fix it but never mind I will try. If I will be successful I'll send Pull requests to both of yours and this repository. Thanks for your attention! 👍 😄 |
I think you're overestimating how much I remember about either Python, AIML, or PyAIML after ~10 years; I would effectively be approaching a completely unfamiliar codebase at this point. I don't think it would be terribly easy for either of us :) Is the AIML 2.0 spec fairly stable and well-supported at this point? I'd hate for you (or anybody) to put a lot of work into supporting a draft specification, and end up subtly incompatible with other interpreters. |
friends i have developed support for learn tag can i share here |
Sure thing. PRs welcome!
…On Sat, Jul 22, 2017 at 2:00 AM athuldevin ***@***.***> wrote:
friends i have developed support for learn tag can i share here
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA44LyZwdUk0ZTx5SDy1kn14NykAjsfuks5sQbo-gaJpZM4IUKxM>
.
|
https://github.com/athuldevin/learn the complete pyaiml files and learn.aiml is available here ability to save bot predicates which set dynamically and restore also problem also developed support for javascript tag but not included in this kernel because it require one additional package , if you like i will share |
@athuldevin after a while I realized that learn.aiml of Steve Worswick is a little bit overrated. So recently I wrote this script which has superior capabilities then the combination of an AIML interpreter and learn.aiml file. In general, state-of-the-art NLP techniques (like spaCy) pretty much made AIML redundant. |
@mertyildiran can you say where should i go for learn more about advanced stuff like this i am a student |
An easy way for the pyaiml bot to "learn" is to create a separate py "file writing" script that you send through args the information you want your ai to learn. Then reload the aiml file it wrote to. Example: a short example of my are_learning.py file:
I hope this helps |
Hey @creatorrr , thanks for this great library!
I'm facing with a problem while trying to use these learn.aiml files with your library.
Mitsuku: http://www.square-bear.co.uk/aiml/learn.zip
ALICE: http://alicebot.wikidot.com/learn-aiml (WRONG/OUTDATED)
It's trapping in to an infinite loop, how can I solve that? This is the error.log from the beginning to KeyboardInterrupt.
stderr:
With these usage attempts both of them has same problem:
The text was updated successfully, but these errors were encountered: