AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

AIML converted to ChatScript?
 
 
  [ # 16 ]

I’m confused, not being an AIML expert. I thought “think” was supposed to do stuff silently so what does displaying said variables name and seeing a previously set value, etc, have to do with anything?

 

 
  [ # 17 ]

You’re correct about the <think> tag. What I was getting at was how the PHP code was going to make the transition from AIML to ChatScript when you have two similar items, but with completely different outputs. Both of these lines of AIML code:

<think><set name="foo">bar</set></think>

<
set name="foo">bar</set

do the same thing, behind the scenes, but the second one is supposed to additionally output something (namely, the value of foo, which is “bar”)

 

 

 
  [ # 18 ]

I understand. Locally one could code them differently but ultimately it would have to be a runtime issue, because the think might have called something deep that is doing that. One could always code the set as the actual set, followed by
if ($$think == 0) { $foo }  which displays the value. and the <think> tag could do $$think += 1 and $$think -= 1 when it completed.

 

 
  [ # 19 ]

Incrementing/decrementing a $$think variable is a good idea, as some {poorly written} AIML may contain nested <think> tags, thus could potentially cause issues if the $$think variable were used as a boolean (true/false).

 

 
  [ # 20 ]
Dave Morton - Sep 21, 2013:

That all looks great, so far, but what are we looking at, code-wise, for conversion of the following:

(See: Dave’s original post.)

And if you want to discuss this at some point in a less public setting, either Skype me (the left sidebar here has a link), or shoot me an email.

Yes, I would enjoy a chat.  Thanks for the invitation, Dave.
Can you interpret my usable inferior markup language?

=====================================================            Example for discussion purposes only using my own methods
=====================================================

<?xml version="1.0"?>
<root>
    <
element>
        <
mum><put attr="foo">bar</put></mum>
    </
element>
    <
element>
        <
put attr="foo">bar</put>
        <
let attr="foo"/>
    </
element>
</
root

Of course there is more than one way to skin a category (A.I. humor!).
But if it is a tree of XML nodes, why not try traversing it recursively?

=====================================================            Example for discussion purposes only using my own methods
=====================================================

root
    
2 tags:

element    
 1 tag
:mum
  1 tag
put "bar"
   
attr"foo"

element
 2 tags
:put "bar"
  
attr"foo"
   
let attr"foo" 

 

 

 
  [ # 21 ]
∞Pla•Net - Sep 22, 2013:

But if it is a tree of XML nodes, why not try traversing it recursively?

Well, that’s more or less the point, actually, since AIML is a somewhat recursive architecture. After all, that’s what the <srai> and <sr> tags are. smile

As to interpreting your code, it looks like the same thing as <set> and <get> in AIML. Nothing out of the ordinary about it, actually. Or were you referring to the ChatScript code?

 

 
  [ # 22 ]
Dave Morton - Sep 25, 2013:
∞Pla•Net - Sep 22, 2013:

But if it is a tree of XML nodes, why not try traversing it recursively?

Well, that’s more or less the point, actually

Wonderful, Dave… Recursion is a great topic, isn’t it?

Yes, and you must have known that, $$foo, which you mentioned, may also be used in recursion.  In that, variables may be named by a value in an array that is being recursively parsed.  I guess that, $$foo, may be sort of convenient.  Otherwise, I was just attempting some A.I. humor… UIML (usable inferior markup language). smile  But, I was using the sample UIML to suggest that “two similar items” may be distinguished using such a method.

 

 
  [ # 23 ]

Problem I’m running into with my converting AIML Alice to CS Alice project - Topics and keywords.  Hardly any of the AIML files have them, and it seems like they aren’t really a used feature in the Alice set.  If the Alice files are all looked at to find responses but upon conversion into topic files they aren’t because of their lack of keywords and organization by topic - well, there is my problem. 

Am I missing something?  What is the solution?  Is there a topic with (*) as keyword so it gets checked every time for rejoicers?  Do I have to write a different controller for the Alice bot that acts like AIML does?  I’m trying to figure out the right direction.

 

 
  [ # 24 ]

You are not missing something.  AIML has “topics” but doesn’t use them (they don’t work well).
The control script can call respond on a topic instead of using keywords.  The harry ~keywordless topic is such a topic.
So you can dump all your rules into there.

And you can subdivide further by doing
u: () respond(~mynexttopic)
any number of times from the keywordless topic if you want to cluster your rules or there get to be too many in keywordless.

 

 
  [ # 25 ]

Makes sense.  I want to be able to add new converted aiml files ad hoc via drop in - is is possible to make a controller that looks through all files with ~keywordless as the keyword, or maybe iterates through all files with -aiml.top as the prefix.  I’m planning on re-writing the controler a bit for this project anyway just looking for a bit of guidance before I get started on that. 

Having a AIML -> CS converter will mean people will want to convert their files and drop them into CS and go.  I think it’s very common to start with the Alice set, which is why I’m trying have my converter able to convert the entire Alice set for sure.  I could generate the ~keywordless topic I suppose, but then that doesn’t make dropping files in ad hoc work. 

That said, there is likely to be some hand editing of the files required due to imperfect conversion, needing to interpret the intent, etc.  So maybe expecting them to add a line in the ~keyworldless topic isn’t so bad.  I’m just trying to lower the AIML > CS barrier as much as possible.

 

 
  [ # 26 ]

if you want to create an arbitrary number of topics that can be triggered by keyword, you could define the topics with a fake keyword like topic: ~myaiml1 (aimlkey) 
and then in your control script near the top add in
  ^mark(aimlkey)
This would mean whenver the system was later looking for responder topics that matched, it would go to any topic with that key as well.  This is the mechanism I use for keywordless idioms. I have an early topic that looks for idioms like this:
u: (what do you do >) mark(~work)
u: (what do you ~like to do >) mark(~hobby)
and then the corresponding question would also be caught within the ~work topic.

 

 
  [ # 27 ]
Bruce Wilcox - May 9, 2014:

if you want to create an arbitrary number of topics that can be triggered by keyword, you could define the topics with a fake keyword like topic: ~myaiml1 (aimlkey) 
and then in your control script near the top add in
  ^mark(aimlkey)

Perfect!  Thanks.  smile

 

 

 
  [ # 28 ]
Bruce Wilcox - May 9, 2014:

AIML has “topics” but doesn’t use them (they don’t work well).

As with all programming languages, they work as well as the person doing the coding.smile
Topics are pretty useful for keeping things together. Answering questions like “Do you have one” without having to work out what “one” is.

 

 
  [ # 29 ]

AMIL converted to ChatScript?

(Dave, is it really necessary for the title of this topic to remain with a the misspelled “AMIL”? ;^))

I look forward to an open source tool for the conversion of AIML into ChatScript (and vice versa?).

I’ve done a fair bit of conversions into and out of AIML using XSLT.  Typically some functionality is lost each way.

I would like to see a comprehensive visual mapping of AIML to ChatScript, in other words, a complete inventory of the functions of each one, then see them mapped to one another (wherever applicable).

 

 
  [ # 30 ]

Steve said: As with all programming languages, they work as well as the person doing the coding.smile
Topics are pretty useful for keeping things together. Answering questions like “Do you have one” without having to work out what “one” is.

Absolutely. Steve is a god with AIML. But the public AIML files released by Dr Wallace only used them about 4 times, and in each case use of it meant once you entered the topic you couldnt leave. So he wasn’t using them. And my complaint with them is you have to trigger them from outside.  This is fine when you are generically deciding to launch some topic of conversation (and yes using it for pronoun resolution is fine), but is less practical to have all your answers to questions in a baseball topic when to enter that topic you have to separately detect all the keywords you need so as to launch the topic.

 

 < 1 2 3 > 
2 of 3
 
  login or register to react