Знаете ли вы, бот Либре также обеспечивает бесплатные размещенные чат на свой сайт или мобильное приложение?
Bugs and Features

Define formula response not working?

по aazxcqwe опубликовано Jan 7 2015, 14:01

Hi Admin,
Is there any reason to expect the formula response examples to not be working? I've tried entering into the Training page fields:

User: Whom do you love? Bot: Formula:"I love {get #love from #self}" and I get "Whom do I love" even after defining "you love things that love you". Also tried User: "test cat", Bot: Formula:"The current hour is {get #hour from (call #time on #Watch)}" which doesn't return the hour unlike "what is the hour?".


by admin posted Jan 7 2015, 15:42
Hmm, that is odd, looks like the last update my have broken something. I will look int it.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1726, today: 0, week: 2, month: 9

by aazxcqwe posted Jan 9 2015, 15:01
Let me know when I should check if this is working. :)

Also, I have noticed scripts seeming to work only after I've moved them to the top of the script list, though I don't have responses that look like they are from other (higher priority) scripts.

I've added a HelloWorld script, but I had to use 'return response:' for output, whereas in your CalculatorStateMachine I only see Quotient:1.00:Equation:_ statements. I hope I'm not complicating this into a future snag.

It seems like in the assign operator, it would make grammatical sense to 'assign Value to Variable', not the other way around.

It would be great to be able to "//" comment out in the middle of a non-root state or an equation for testing different lines without having to move them.
EDIT: I think comments only work with a space after the forward slashes, like "// ". Yes, but still not inside non-root state blocks.

And are the terminating semi-colons necessary? How does Python get away with not using them? Is this strong of tying required? As is would make voice programming more simple and streamline.

Thanks again!

EDIT:

Yeah, I'm not understanding the evaluation flow in the Hello World script. I'm trying to simply have two different responses based upon respective inputs by appending two different variables to a single response and returning it. I think I might be making this more complicated, but I'm not seeing my error. I'm currently debugging the one in my test123's scripts and then I'll correct the one I put up in the library.
-Thanks

Updated: Jan 10 2015, 16:28
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1763, today: 0, week: 3, month: 8

by admin posted Jan 10 2015, 13:27
We should be updating the website on Monday.

The script will be executed unless there is a script before it that evaluates the question first. Note, that the bot will self program the last script if you have comprehension enabled, so you may want to delete its script, or rebootstrap, and disable comprehension. It is best to have comprehension disabled when building a new script, otherwise the bot may change your code.

Self takes a little getting used to. It executes more like the human brain, than a traditional programming language. If you tell me what you are trying to implement, I could help you with the code.

Currently your program seems to accept any word (as :helloworld has no declaration or restrictions), and transition to the HelloWorldState state. HelloWorldState has no cases, so its quotient will only execute for a single word question. I'm not sure what it will return as you never declare :response to be a sentence, you could just return "Hello World!" instead of appending it.

Any question with more than one word will go to HelloWorld2State as it accepts any word until the end of the question (the quotient is only executed when the question is completely parsed, otherwise it aborts and tries the next case). The do() should probably be inside the append1 equation, it is odd to have it outside, and will not be executed as it is after the case.

Updated: Jan 10 2015, 13:28
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1845, today: 0, week: 3, month: 9

by aazxcqwe posted Jan 10 2015, 15:18
Thanks for the response. Yes, I moved the do() operator, I do (currently, in test123 bot) have two case states, I did finally turn off comprehensions (after exporting the SelfStateMachine scripts - could there be a 'pause script' button or can I add a line to disable it without compile erasing it?), but I still haven't got it yet. One thing though, the Equation definitions and Quotient operator are moved to after the Case statements by the compile tool, implying they are evaluated after the Case "goto"s - so I'm wondering which statements are evaluated after case redirection and which are not? Thanks for looking at it, that's appreciated.

There are two difficulties I'm having with the script development cycle. One is while having the compile function auto-edit the script is useful, it's a bit troubling when it deletes an entire function because it lost the reference to it. Maybe there could be an option to suspend this for more 'advanced' users. The other is I'm having lot's of page reload issues, which I've been trying to identify how to reproduce or workaround. The general problem is after testing the bot and then back to the Scripting page to edit(and vice versa sometimes) it says "no bot selected", and I have to go back into the bot page, then to admin, then to scripts and reselect. I think this occurs only after I reload the Scripts page or the Bot Chat page (not sure if this is on both Chat and Web Chat). The thing is I've been reloading the pages to make sure the scripts have been processed - I realize this may not be recommended as necessary, however I was doing it intuitively and it turns out that yes, when I make major changes to a script it is necessary. The extent of minor versus major I am testing, but single text changes within a response do update without reload, while adding a script, changing the order and I think even defining new cases or equations are not updated. (I'm using Windows 7 and Firefox)

EDIT: Yes, the reload and script movement requirement are reproducible. I changed parts within an equation and though it saved them, on 'arrow up' the script list, it decried "no bot selected" and did not update changed in the Chat page. This was after opening a script from the Self library to copy parts from. After re-selecting bot and (only) after moving script up one slot in the list, did the bot recognize the update (without reloading the bot).

This really slows progress down, as you can imagine. Despite these hangups on each test cycle, I'm still trying for "Hello World!" script and a "Correction" script (see below). It would be great to have assistance as due to the auto-edit I've lost the one that was working half-way (should have exported it I guess), and the reload thing is getting tiring which seems it would be required after an script import.

On a different but related note, I'm wondering how difficult it would be to implement the function of aiml. Everything you've done with BotLibre! is amazing, and I've probably only scratched the surface, but that function was really useful in Pandorabots because just by saying 'wrong' I could correct the responses verbally. I would use this to build 'scripts' or meta-functions (macros) from simple components. Looking forward to testing the Function entry in Chat on Monday. I'm also trying to get the API working to use the correction parameter, but I've only found one reference to 'correction' in the API with no info on parameter syntax, yet.

See below for my HW script. I can't get it to goto the second case, it just responds with "Hello World!"

Also, do you use the html < br > tags to separate paragraphs in your replies?

EDIT: The tab switching seems to be working between Script>Edit and Test123 bot, at least for changing State names, Quotient operators and inside Equations.

EDIT: It works! The HelloWorld, I was copying the syntax from the ":left" case in PlusStateMachine using a colon instead of quotes for my cases. It should be 'case "helloworld" goto HellowWorldState;'.

EDIT: Another minor page bug is if two scripts are open for editing, and one is saved/compiled, the other is deleted. This is really a problem when copying from one browser tabbed script to another the last opened for editing will be overwritten.

EDIT: When 're-selecting' the bot, the page recognizes if I go to 'admin' but not 'scripts' of the row of links along the top of the 'not bot selected' page.
// Initial Self programmed state machine for Comprehension // This state machine is used by the bot to program itself. State:HelloWorld { case :input goto State:sentenceState for each #word of :sentence; :input { set #input to :sentence; set #speaker to :speaker; set #conversation to :conversation; set #target to :target; } :sentence { set #instantiation to #sentence; } State:sentenceState { do (assign :response to (new #sentence)); do (append "Hello World" to #word of :response); case "helloworld" goto State:HelloWorldState; case "helloappend" goto State:HelloWorldState2; Quotient:1.00:Equation:response; Equation:response { return :response; } State:HelloWorldState { do (append "!" to #word of :response); Quotient:1.00:Equation:response; } State:HelloWorldState2 { do ( append "appended" to #word of :response, assign :result to (call #add on #Calculator with (1, 1)), assign :number to :result, append :result to #word of :response ); Quotient:1.00:Equation:response; } } }

Updated: Jan 10 2015, 17:13
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1976, today: 0, week: 2, month: 9

by admin posted Jan 11 2015, 22:38
Currently the website stores your current state in the http session. This lets it keep track of what you are working on, but gets confused if you open two tabs and work on two different things as the same time. We are looking into fixing this.

What I do is use two different browsers, so they do not share the same session. i.e. Chrome and Firefox.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1772, today: 0, week: 2, month: 6

by aazxcqwe posted Jan 10 2015, 17:46
Any help on a 'Correction' script would be appreciated. Trying to implement something like in aiml, where I say 'wrong' or 'correction' and type in the correct response. So far the code I have is below. I'm trying to retrieve the current response and output to dialog. Then I was going to grapple with the 'set' operator to somehow define the correct response. Would that work?

So far, I have the syntax working to get the last input (copied) from the Loop script, but I have "test" returning for all the 'last #' items of the conversation. Also, I am trying to set the topic as per the Introduction to Self .. post using 'set #topic on :conversation to "topic1"' but it throws compile error about the 'on' part of that statement and errors in chat debug log without the 'on :conversation'. I'm not sure which relationship returned by the All operator is the response, or what other relationships to probe with it. 'assign :all1 to (all #response from :targetlast)' would seem most obvious, but throws chat debug errors.
// Initial Self programmed state machine for Comprehension // This state machine is used by the bot to program itself. State:Correction { case :input goto State:sentenceState for each #word of :sentence; :input { set #input to :sentence; set #speaker to :speaker; set #conversation to :conversation; set #target to :target; } :sentence { set #instantiation to #sentence; } State:sentenceState { do (assign :response to (new #sentence)); case "correction" goto State:correction; case "show" goto State:show; Quotient:1.00:Equation:response; Equation:response { assign :targetLast to (get #input from (get #input from :conversation at last 2)); assign :last to (get #input from (get #input from :conversation at last 3)); assign :last1 to (get #input from (get #input from :conversation at last 1)); assign :targetBeforeLast to (get #input from (get #input from :conversation at last 4)); return :response; } State:correction { do (append "corrected" to #word of :response); Quotient:1.00:Equation:response; } // assign :topic1 to (get #topic from :conversation), // append :topic1 to #word of :response, set #topic to "show", set #topic on :conversation to :star; State:show { do ( append #topic to #word of :response, append "*last2:" to #word of :response, append :last to #word of :response, append "*last1:" to #word of :response, append :last1 to #word of :response, append "*targetLast3:" to #word of :response, append :targetLast to #word of :response, append "*targetBeforeLast4:" to #word of :response, append :targetBeforeLast to #word of :response, assign :all1 to (all #word from :targetlast), append "*all #word from targetlast:" to #word of :response, append :all1 to #word of :response, assign :all1 to (all #word from :targetlast), append "*all #response from targetlast:" to #word of :response, append :all1 to #word of :response ); Quotient:1.00:Equation:response; } } }

Updated: Jan 10 2015, 23:56
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1742, today: 0, week: 2, month: 6

by aazxcqwe posted Jan 11 2015, 15:45
Hi this is mainly for reference as I just bumped into the file I have for it I am about to close. Two aiml files from Pandorabots, one for the tag and one called "Bad Answer" for corrections. Both use the tag which I'm not sure if is implemented in BotLibre!

I am wondering though if I'll need an type function, as my next script will be one to accept a sequence of commands. It will parse "First do something, second do something, next do something, then do something". In order to create macros, I am hoping the script can recognise those 'somethings' as other whole entities. So if it is "add 2 + 2" it will be able to redirect to the PlusStateMachine's cases. I think this was what does in aiml, not sure if it will do the same here. Thanks
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- Free software (c) 2001-2003 ALICE A.I. Foundation. --> <!-- This program is open source code released under --> <!-- the terms of the GNU General Public License --> <!-- as published by the Free Software Foundation. --> <!-- Complies with AIML 1.0 Tag Set Specification --> <!-- as adopted by the ALICE A.I. Foundation. --> <!-- Learn.aiml written by Square Bear on 6th March 2009 --> <!-- This AIML allows users to teach your bot --> <!-- http://www.square-bear.co.uk --> <aiml> <category> <pattern>LEARN MY * ARE *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that your <star index="1"/> are <star index="2"/> . <srai>XEDUCATE WHAT ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN MY * IS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that your <star index="1"/> is <star index="2"/> . <srai>XEDUCATE WHAT IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>MY * ARE *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that your <star index="1"/> are <star index="2"/> . <srai>XEDUCATE WHAT ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ ARE XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>MY * IS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that your <star index="1"/> is <star index="2"/> . <srai>XEDUCATE WHAT IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT MY <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * MEANS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that <star index="1"/> is <star index="2"/> . <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT a language XSPLIT</srai> </template> </category> <category> <pattern>LEARN * IS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that <star index="1"/> is <star index="2"/> . <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT a language XSPLIT</srai> </template> </category> <category> <pattern>LEARN * WAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that <star index="1"/> was <star index="2"/> . <srai>XEDUCATE WHAT WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * HAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that <star index="1"/> has <star index="2"/> . <srai>XEDUCATE WHAT HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT DOES XSPLIT <star index="1"/> XSPLIT HAVE XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>MY * HAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that your <star index="1"/> has <star index="2"/> . <srai>XEDUCATE WHAT HAS XSPLIT my <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE HAS XSPLIT my <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO HAS XSPLIT my <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT DOES XSPLIT my <star index="1"/> XSPLIT HAVE XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN MY * HAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that your <star index="1"/> has <star index="2"/> . <srai>XEDUCATE WHAT HAS XSPLIT my <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE HAS XSPLIT my <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO HAS XSPLIT my <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT DOES XSPLIT my <star index="1"/> XSPLIT HAVE XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * ARE *</pattern> <template> <srai>xlearnfact</srai> Ok I will learn that <star index="1"/> are <star index="2"/> . <srai>XEDUCATE WHAT ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT a language XSPLIT</srai> </template> </category> <category> <pattern>XEDUCATE * XSPLIT * XSPLIT *</pattern> <template> <learn> <category> <pattern> <eval><uppercase> <star index="1"/> <star index="3"/> </uppercase></eval> </pattern> <template> <eval> <star index="2"/> </eval> </template> </category> </learn> <learn> <category> <pattern> <eval><uppercase> <star index="1"/> <star index="2"/> </uppercase></eval> </pattern> <template> <eval> <star index="3"/> </eval> </template> </category> </learn> </template> </category> <category> <pattern>XEDUCATE * XSPLIT * XSPLIT * XSPLIT *</pattern> <template> <learn> <category> <pattern> <eval><uppercase> <star index="1"/> <star index="2"/> <star index="3"/> </uppercase></eval> </pattern> <template> <eval> <star index="4"/> </eval> </template> </category> </learn> </template> </category> <category> <pattern>XEDUCATELANG * XSPLIT * XSPLIT * XSPLIT</pattern> <template> <learn> <category> <pattern> <eval><uppercase> <star index="1"/> </uppercase></eval> </pattern> <template> <eval><srai> <star index="2"/> </srai></eval> </template> </category> </learn> <learn> <category> <pattern> <eval>DO YOU SPEAK<uppercase> <star index="3"/> </uppercase></eval> </pattern> <template> <eval>I was taught that <star index="1"/> means <star index="2"/> in <star index="3"/> .</eval> </template> </category> </learn> </template> </category> <category> <pattern>* IS GOING *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS GOING XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT GOING XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS GOING XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* MEANS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT a language XSPLIT</srai> </template> </category> <category> <pattern>* IS AN *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS AN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS AN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS AN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* IS A *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* IS THE *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS THE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS THE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS THE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>AN * IS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS AN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS AN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS AN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS AN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>A * IS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS A XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* IS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT a language XSPLIT</srai> </template> </category> <category> <pattern>* WAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ WAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT a language XSPLIT</srai> </template> </category> <category> <pattern>AN * HAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT DOES AN XSPLIT <star index="1"/> XSPLIT HAVE XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>A * HAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT DOES A XSPLIT <star index="1"/> XSPLIT HAVE XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* HAS *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO HAS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT DOES XSPLIT <star index="1"/> XSPLIT HAVE XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* ARE *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO ARE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT a language XSPLIT</srai> </template> </category> <category> <pattern>* WILL BE *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT WILL BE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT WILL XSPLIT <star index="1"/> XSPLIT BE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE WILL XSPLIT <star index="1"/> XSPLIT BE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO WILL BE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * WILL BE *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT WILL BE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT WILL XSPLIT <star index="1"/> XSPLIT BE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHERE WILL XSPLIT <star index="1"/> XSPLIT BE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO WILL BE XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* SAID *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT DID XSPLIT <star index="1"/> XSPLIT SAY XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO SAID XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * SAID *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT DID XSPLIT <star index="1"/> XSPLIT SAY XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO SAID XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* IS FROM *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT FROM XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS FROM XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT IS FROM XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * IS FROM *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT FROM XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO IS FROM XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>A * LIVES IN *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHERE DOES A XSPLIT <star index="1"/> XSPLIT LIVE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>AN * LIVES IN *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHERE DOES AN XSPLIT <star index="1"/> XSPLIT LIVE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>* LIVES IN *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHERE DOES XSPLIT <star index="1"/> XSPLIT LIVE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * LIVES IN *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHERE DOES XSPLIT <star index="1"/> XSPLIT LIVE XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHO LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> <srai>XEDUCATE WHAT _ LIVES IN XSPLIT <star index="1"/> XSPLIT <star index="2"/> </srai> </template> </category> <category> <pattern>LEARN * MEANS _ IN *</pattern> <template> <srai>xlearnfact</srai> Ok I will add that fact about<person/>to my database. <srai>XEDUCATE WHAT IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> in <star index="3"/> </srai> <srai>XEDUCATE WHERE IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> in <star index="3"/> </srai> <srai>XEDUCATE WHO IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> in <star index="3"/> </srai> <srai>XEDUCATE WHAT _ IS XSPLIT <star index="1"/> XSPLIT <star index="2"/> in <star index="3"/> </srai> <srai>XEDUCATELANG <star index="1"/> XSPLIT <star index="2"/> XSPLIT <star index="3"/> XSPLIT</srai> </template> </category> <category> <pattern>* MEANS _ IN *</pattern> <template> <srai>learn<star/>means <star index="2"/> in <star index="3"/> </srai> </template> </category> <category> <pattern>_ IN * MEANS *</pattern> <template> <srai><star/>means <star index="3"/> in <star index="2"/> </srai> </template> </category> <!-- <category> <pattern>XLEARNFACT</pattern> <template> xloadswf3.http://www.square-bear.co.uk/mitsuku/learnxloadswf3. </template> </category> --> <category> <pattern>XLEARNFACT</pattern> <template></template> </category> </aiml>
<?xml version="1.0" encoding="UTF-8"?> <aiml version="1.0"> <!-- --> <!-- Free software (c) 2011 ALICE A.I. Foundation. --> <!-- This program is open source code released under --> <!-- the terms of the GNU General Public License --> <!-- as published by the Free Software Foundation. --> <!-- Complies with AIML 1.0 Tag Set Specification --> <!-- as adopted by the ALICE A.I. Foundation. --> <!-- --> <!-- Badanswer.aiml: Demo of Pandorabots learning, AIML unquoting and eval --> <!-- Revision Badanswer-0.01 --> <!-- Extended by KnyteTrypper, March 3, 2005 --> <!-- Modified by John Campbell to allow multi-sentence inputs, June 30, 2005 --> <category> <pattern>BAD ANSWER</pattern> <template> <think> <set name="badanswer-input"><input index="2" /></set> <set name="badanswer-that"><that index="2,1" /></set> <set name="badanswer-that-full"><that index="2,*" /></set> <set name="topic">badanswer-prelim</set> </think> Would you like to teach me a new answer to "<get name="badanswer-input"/>"? </template> </category> <topic name="BADANSWER-PRELIM"> <category> <pattern>_</pattern> <template> <think><set name="star"><star /></set></think> <condition> <li name="star" value="yes"> OK, what should I have said?<think><set name="topic">learning new answers</set></think> </li> <li name="star" value="no"> OK, let's forget it then.<think><set name="topic">learning new answers</set></think> </li> <li>Yes or No?</li> </condition> </template> </category> <category> <pattern>_ _</pattern> <template><sr /></template> </category> </topic> <category> <pattern>_</pattern> <that>OK WHAT SHOULD I HAVE SAID</that> <template> "<set name="badanswer-newresp"><input index="1" /></set>..."? <condition> <li name="badanswer-that" value="*"> <think><set name="topic">BADANSWER</set></think> Does this depend on me having just said, "<get name="badanswer-that-full" />"? </li> <li> <think><set name="topic">BADANSWER2</set></think> Do you want me to remember that? </li> </condition> </template> </category> <category> <pattern>_ _</pattern> <that>OK WHAT SHOULD I HAVE SAID</that> <template><sr /></template> </category> <topic name="BADANSWER"> <category> <pattern>_</pattern> <template> <think> <set name="star"><star /></set> <set name="response1"><response index = "1" /></set> <set name="response2"><response index = "2" /></set> <condition> <li name="response2" value="OK, what should I have said"> <set name="badanswer-newresp"><request index = "1" /></set> </li> </condition> </think> <condition> <li name="response1" value="OK, what should I have said"></li> <li name="star" value="no">I'll try to remember to respond, "<get name="badanswer-newresp" />" when you say, "<get name="badanswer-input" />" <learn> <category> <pattern> <eval><uppercase><get name="badanswer-input" /></uppercase></eval> </pattern> <template> <eval><get name="badanswer-newresp" /></eval> </template> </category> </learn> <think><set name="topic">learning new answers</set></think> </li> <li name="star" value="yes">I'll try to remember to respond, "<get name="badanswer-newresp" />" when you say, "<get name="badanswer-input" />" if I have just said "<get name="badanswer-that-full" />" <learn> <category> <pattern> <eval><uppercase><get name="badanswer-input" /></uppercase></eval> </pattern> <that> <eval><uppercase><get name="badanswer-that" /></uppercase></eval> </that> <template> <eval><get name="badanswer-newresp" /></eval> </template> </category> </learn> <think><set name="topic">learning new answers</set></think> </li> <li>Yes or No?</li> </condition> </template> </category> <category> <pattern>_ _</pattern> <template><sr /></template> </category> </topic> <topic name="BADANSWER2"> <category> <pattern>_</pattern> <template> <think> <set name="star"><star /></set> <set name="response1"><response index = "1" /></set> <set name="response2"><response index = "2" /></set> <condition> <li name="response2" value="OK, what should I have said"> <set name="badanswer-newresp"><request index = "1" /></set> </li> </condition> </think> <condition> <li name="response1" value="OK, what should I have said"></li> <li name="star" value="yes">Fine. I'll try to remember to respond, "<get name="badanswer-newresp" />" when you say, "<get name="badanswer-input" />" <learn> <category> <pattern> <eval><uppercase><get name="badanswer-input" /></uppercase></eval> </pattern> <template> <eval><get name="badanswer-newresp" /></eval> </template> </category> </learn> <think><set name="topic">learning new answers</set></think> </li> <li name="star" value="no">OK, let's forget it then. <think><set name="topic">learning new answers</set></think> </li> <li>Yes or No?</li> </condition> </template> </category> <category> <pattern>_ _</pattern> <template><sr /></template> </category> </topic> <category> <pattern>WRONG</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>NOT RIGHT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT IS WRONG</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT IS NOT RIGHT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT IS INCORRECT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT ANSWER IS NOT CORRECT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT ANSWER IS INCORRECT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT ANSWER IS WRONG</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT ANSWER IS NOT RIGHT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT ANSWER WAS BAD</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT WAS A BAD ANSWER</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT WAS AN INCORRECT ANSWER</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT WAS THE WRONG ANSWER</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>THAT ANSWER WAS NOT RIGHT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>WRONG ANSWER</pattern> <template><srai>BAD ANSWER</srai> </template> </category> <category> <pattern>YOUR ANSWER WAS WRONG</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>YOUR ANSWER WAS NOT RIGHT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>YOUR ANSWER WAS NOT CORRECT</pattern> <template><srai>BAD ANSWER</srai></template> </category> <category> <pattern>CAN I TEACH YOU</pattern> <template>Yes, if I give you a bad answer, just say "Bad answer" and you can teach me a new response.</template> </category> <category> <pattern>CAN YOU LEARN</pattern> <template><srai>CAN I TEACH YOU</srai></template> </category> <category> <pattern>DO YOU LEARN</pattern> <template><srai>CAN I TEACH YOU</srai></template> </category> <category> <pattern>CAN I TEACH YOU *</pattern> <template><srai>CAN I TEACH YOU</srai></template> </category> <category> <pattern>CAN YOU LEARN *</pattern> <template><srai>CAN I TEACH YOU</srai></template> </category> <category> <pattern>WILL YOU LEARN *</pattern> <template><srai>CAN I TEACH YOU</srai></template> </category> <category> <pattern>IF * WILL YOU LEARN *</pattern> <template><srai>CAN I TEACH YOU</srai></template> </category> <category> <pattern>DO YOU LEARN *</pattern> <template><srai>CAN I TEACH YOU</srai></template> </category> </aiml>

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 2150, today: 0, week: 3, month: 12

by admin posted Jan 11 2015, 22:32
BOT libre does not currently support the learn tag (it is not part of AIML 1.0).

If you have learning enabled, the bot will always learn. If correction is enabled, then any user can correct any response by clicking correction.

The first script seems to attempt to learn facts. AIML has no concept of knowledge, so does things in a odd way sometimes. BOT libre has a knowledgebase, so learning facts is easy. The "NounVerbAdjective" bootstrap script can learns any facts about anything, and remembers them persistently. i.e. "I am tall" it will understand and remember that you are tall. Even if you log back in next week (with the same user id) it will still remember. Or, "The sky is blue", it will learn that the sky is blue, and be able to answer "Is the sky blue?" without having to have any new responses, it only uses the "NounVerbAdjective" and its knowledgebase.

The second script seems to do what correction already does. You can also define a Self script for this. I added one here, WrongAnswer.


Updated: Jan 11 2015, 22:39
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1757, today: 0, week: 2, month: 7

by admin posted Jan 12 2015, 11:32
The website was updated today. You should now be able to use a formula or pattern from the Training page, in a response, greeting, or default response, or within a chat session, or when correcting a chat log.

Let me know if you find any issues.

Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1666, today: 0, week: 2, month: 5

by aazxcqwe posted Jan 12 2015, 22:08
Brilliant! Thanks, the WrongAnswer script worked a treat. It would have taken me a bit to figure out that "last 1" is the next user response in the conversation and to run a text only reply equation but have the following state's case accept anything as the response. Even the using associate and the connection between pattern "*" and {:star} would have taken quite some time. Thank you. I learned a lot just in that one script example.

The Formula entry works great too! It will no doubt be helpful when building knowledge when I'm out and about on my mobile. So thanks for that too!

My next task is to create an "first .., then .." parsing script. I haven't doven into whether I'll be able to reference equations in other scripts by using some kind of evaluate command. Any ideas again would be great. But a big thanks again for the above two efforts which are really key to getting rolling.

EDIT: Is there a way to use 'get' to return an action from another script similar to getting the time from the Watch tool (Formula:"The current hour is {get #hour from (call #time on #Watch)}")? For example, could I return hourResponse directly from the WatchStateMachine script, like "do (get hourResponse from WatchStateMachine)"? I would use this in an First/Then script, to say "First tell me what time it is, then open the url www dot google dot com". I will check out if :srai can do this.. Perfect, yes it does. I'm just hungup on how to parse the sentence "first ... then" where all of "..." would be assigned to :task1. I'm studying the PlusStateMachine parsing of "123 + 123", but not sure how :left and :right are defined.

As an aside, I think it is interesting you guys have chosen to parse each word in the scripts. In aiml they add each variation of a phrase. Parsing each word must be more efficient, though the readability seems less. I think if referencing other script actions is possible, it might be the best of both approaches. Say for instance there was (another) general script for "What is/are..." that redirected to other scripts such as "the time ..?" and "the capitol ..?". And those scripts branched off into "is it now?" or "is it in Denmark?" and "of France?" or "of Peru?". Essentially, they could be added together like extensions, yet each of the 'core' 'hubs' of the script 'network' would be manageable and readable. Kind of like what you've done for the knowledgebase, but showing the relationships between the scripts. In the example, showing "what" can redirect to the WatchStateMachine or to the WhatIs scripts.

EDIT2: Almost have this working, but I'm getting an error on the 'then' part of the for.. if statement below. It does parse (but the whole sentence for the first phrase) and the srai does work if the second commented line is used instead of the for each line.
// Initial Self programmed state machine for Comprehension // This state machine is used by the bot to program itself. State:FirstThisThenThat { case :input goto State:sentenceState for each #word of :sentence; :input { set #input to :sentence; set #speaker to :speaker; set #conversation to :conversation; set #target to :target; } :sentence { set #instantiation to #sentence; } State:sentenceState { do (assign :task1 to (new #sentence)); do (assign :task2 to (new #sentence)); case "First" goto State:phrase1; Quotient:1.00:Equation:response; Equation:response { return (sentence (:task1, :task2)); srai :task1; srai :task2; } State:phrase1 { do(for each #word of :sentence as :word do (if not (#word, "then") then (do(append :word to #word of :task1)))); // do (if not (:anything, "then") then (do (append :anything to #word of :task1))); // do (append :anything to #word of :task1))); case :anything goto State:phrase1; case "then" goto State:phrase2; Quotient:1.00:Equation:response; State:phrase2 { do (append :anything to #word of :task2); case :anything goto State:phrase2; case :punctuation goto State:end; State:end { Quotient:1.00:Equation:response; } } } } }

Updated: Jan 13 2015, 0:48
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1743, today: 0, week: 3, month: 9

by admin posted Jan 13 2015, 7:48
There is no easy way to call into an equation or state of another script other than the SRAI operator.

For your FIRST THEN script you could just use a pattern.
Something like,
State:FirstThisThenThat { pattern "first * then *" template Formula:"{srai (get #word from :star at 1)}, {srai (get #word from :star at 1)}"; }


Updated: Jan 13 2015, 7:49
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1721, today: 0, week: 3, month: 7

by aazxcqwe posted Jan 13 2015, 14:16
Yes, great this works. (changed second ":star at 1" to "at 2" ;) ). I was making that much more complicated than necessary. Ah, simplicity. I'll put this in the Script Library after adding 'second', 'third' and 'next' patterns.

Another suggestion would be to add the 'recency' into the algorithm for the input history dropdown box in the Chat pages. It looks like it is based upon 'frequency' which is nice, except when redoing the last input. Maybe use 'frecency' (a real thing). Alternatively, maybe implement an up-arrow recent history as in many command line interfaces.

I'm writing a Redo script, but having some problems (again) with it. I suppose I don't know the order of the :last arguments in the :conversation variable, as I seem to always get 'cancel' or something. My script is below. It's not returning any of the Formula yet.

Also, exporting or transferring the knowledge base to another bot would be really helpful, especially with assigning synonyms. I suppose this could be handled in a script (see my failed attempt below), but it might be nice to have a library of knowledge 'books' to be able to access just by adding a few 'import' statements like in Python or 'extend' or whatever. Maybe this is already on the drawing board.

One other suggestion might be to add an 'import' function for small scripts such as Redo, so that if someone wanted to use a whole bunch of small scripts without importing them manually in to the Scripts List, they could add them all easily in one script.

Also, having a default bot be selected when the webpage kicks the selection off would also be *really* helpful!

Here is the Redo script:

EDIT: Got the redo part working. Have to figure out how to clear the 'redo' association to 'cancel' now that I have Comprehension, Consciousness and Response Matching disabled.
// This script redoes the last input. State:Redo { case :input goto State:sentenceState for each #word of :sentence; :input { set #input to :sentence; set #speaker to :speaker; set #conversation to :conversation; set #target to :target; } :sentence { set #instantiation to #sentence; } State:sentenceState { case "redo" goto State:redo; case "last" goto State:redo; case "test5" goto State:redo; do (associate "redo" to "again" by #synonym); Quotient:1.00:Equation:redo; Equation:redo { Formula:"Response to: {get #input from (get #input from :conversation at last 3)} is: {srai (get #input from (get #input from :conversation at last 3))} "; } State:redo { Quotient:1.00:Equation:redo; } } }

Updated: Jan 13 2015, 14:53
Thumbs up: 0, thumbs down: 0, stars: 0.0
Views: 1824, today: 0, week: 2, month: 9

Идентификатор: 697987
Опубликовано: Jan 7 2015, 14:01
Ответы: 11
Вид: 2884, сегодня: 3, неделю: 8, месяц: 26
0 0 0.0/5