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..

Translation Project: AIML to ChatScript
 
 
  [ # 16 ]

K.I.S.S…

Image Attachments
sourcecode001.png
 

 
  [ # 17 ]

Not sure what that is 8pla but it won’t work in AIML. You will need something like:

<category>
<
pattern>I LIKE SPINACH</pattern>
<
template>Are you a fan of the Popeye Cartoons?</template>
</
category>

<
category>
<
pattern>YES</pattern>
<
that>ARE YOU A FAN OF THE POPEYE CARTOONS</that>
<
template>I used to watch him as a childDid you lust after Olive Oyl?</template>
</
category>

<
category>
<
pattern>NO</pattern>
<
that>ARE YOU A FAN OF THE POPEYE CARTOONS</that>
<
template>What cartoons do you watch?</template>
</
category>

<
category>
<
pattern>YES</pattern>
<
that>DID YOU LUST AFTER OLIVE OYL</that>
<
template>You probably like skinny models.</template>
</
category>

<
category>
<
pattern>NO</pattern>
<
that>DID YOU LUST AFTER OLIVE OYL</that>
<
template>Me neitherShe was too skinny.</template>
</
category>

<
category>
<
pattern>NONE</pattern>
<
that>WHAT CARTOONS DO YOU WATCH</that>
<
template>You lead a deprived life.</template>
</
category>

<
category>
<
pattern>MICKEY MOUSE</pattern>
<
that>WHAT CARTOONS DO YOU WATCH</that>
<
template>The Disney icon.</template>
</
category

You could shrink it down further by using the condition tags but I would advise leaving it like that for clarity’s sake.

<category>
<
pattern>_</pattern>
<
that>WHAT CARTOONS DO YOU WATCH</that>
<
think><set name="answer"><star/></set></think>
<
condition name="answer">
 <
li value="NONE">You lead a deprived life.</li>
 <
li value="MICKEY MOUSE">The Disney icon.</li>
<
li>I have not heard of that cartoon.</li>
</
condition>
<
template>The Disney icon.</template>
</
category
 

 
  [ # 18 ]

That’s all well and good for conversion from ChatScript to AIML, but my intent is the opposite. smile however, anyone wanting to translate in that direction would probably have an easier time of things. I’m still working on getting a basic bot to function (my fault, not that of ChatScript), so this project is still on hold. But I’ll get back to it, I’m certain.

 

 
  [ # 19 ]

Steve,

Dave,

Here it is in RiveScript for comparison:


+ i like spinach
- Are you a fan of the Popeye Cartoons?

+ yes
% are you a fan of the popeye cartoons
- I used to watch him as a child. Did you lust after Olive Oyl?

+ no
% are you a fan of the popeye cartoons
- What cartoons do you watch?

+ yes
% did you lust after olive oyl
- You probably like skinny models.

+ no
% did you lust after olive oyl
- Me neither. She was too skinny.

+ none
% what cartoons do you watch
- You lead a deprived life.

+ mickey mouse
% what cartoons do you watch
- The Disney icon.

 

 
  [ # 20 ]

Well, that’s certainly easy to read, but I have a few questions/comments about it:

1.) What if an unexpected but related response is made to a question (e.g. “Yup” instead of “yes”, or “nope” instead of “no”)?
2.) How about a completely unrelated response (“I’m going hiking this weekend”, instead of answering the question)?
3.) What mechanism is in place to handle wild cards (“yes I did”, instead of just “yes”)?
4.) There seems to be a lot of repetition of the bot’s responses in your example. I understand why that is, and it’s a big improvement over AIML, but it’s still a lot of “extra” lines to code.

 

 
  [ # 21 ]
Dave Morton - May 1, 2011:

Well, that’s certainly easy to read, but I have a few questions/comments about it:

1.) What if an unexpected but related response is made to a question (e.g. “Yup” instead of “yes”, or “nope” instead of “no”)?
2.) How about a completely unrelated response (“I’m going hiking this weekend”, instead of answering the question)?
3.) What mechanism is in place to handle wild cards (“yes I did”, instead of just “yes”)?
4.) There seems to be a lot of repetition of the bot’s responses in your example. I understand why that is, and it’s a big improvement over AIML, but it’s still a lot of “extra” lines to code.

It was the teamwork that attracted the news network producers to broadcast my 3D animated chatbot on CNN TV in primetime, which was later crossreferenced in articles in the press.  I see teamwork developing here.

Steve made an excellent illustration that AIML categories is a good intermediate code. Another option may be UML.  Dave, would you mind if we converted your human questions, quoted above, into AIML first?

Yes Dave.  At this given point, I think I see your point, or at least I think I have the same questions. I am wondering if the ‘that’ relational functionality is to the left of the assignment operator (:)

Here is some ChatScript pseudo code I worked out.  Can we use a string to the left of the assignment operator (:)?


‘_’: ( pattern _ ) template a
  ‘template a’: ( pattern b ) template b
      ‘template b’: ( pattern c ) template c
      ‘template b’: ( pattern c ) template c

 

So my question in plain language is, in ChatScript, is this (generally) legal?

‘can I do this’: ( yes ) You can do that.

 

 
  [ # 22 ]

Hi,

when I started writing AIML I decided to be as simple as possible.
So if I remove my annotations
(like “<think><annotation>ethical-value=Z+3</annotation></think>”)
because I haven´t found a ChatScript-tag for my annotations yet,
big parts of my AIML (translated from German, sorry for my pidgin-elements)
are looking like this:

Please keep in mind that my ARTBOT “MALDIX” is alleging that he is the wind:

<category>
< pattern>CORSICA</pattern>
<template><random>
<li>I always liked the island. Thats why I took the Ionian there two and a half tousand years ago.</li>
<li>I think, the most beautiful town of the island is Bonifacio. A wonderful combination of cliff-line and lagoon.</li>
<li>Who do you think you are? Napoleon?</li>
<li>Do you see me moving the waves of river Golo?</li>
<li>If you want to have a sailing-trip to revolve the island, I will puff you from Bastia to Bastia.</li>
<li>Have you ever breathed my air in this woods of cork?</li>
<li>Are Corsean nationalists still throwing bombs?</li>
...
</random></template>
</category>

With a short combination of “delete” and “find-replace”-commands
you can transpose it to ChatScript:

find "<li>" replace "["
find "</li>" replace "]"
find "< pattern>" replace  "u: ("
find "</pattern>" replace "^noerase()"
delete: <category> </category> <template><random> </random></template

u: (CORSICA) ^noerase()

[I always liked the island. Thats why I took the Ionian there two and a half tousand years ago.]
[I think, the most beautiful town of the island is Bonifacio. A wonderful combination of cliff-line and lagoon.]
[Who do you think you are? Napoleon?]
[Do you see me moving the waves of river Golo?]
[If you want to have a sailing-trip to revolve the island, I will puff you from Bastia to Bastia.]
[Have you ever breathed my air in this woods of cork?]
[Are Corsean nationalists still throwing bombs?]
...

If we had a little tool,
which would search concepts inside of the responses (bot-outputs),
we could do things like this:

take a rule
search its output 
for conceptstake the results to an (a)
and 
set in the name of the concept 

Then, we had some other replacements:

find "<pattern>" replace "topic: ~"
and 
find "<li>" replace "a: (<NAME_OF_THE_CONCEPT)" 

In our CORSICA-example:

topic: ~CORSICA noerase []
t: ...
a: (~like) I always liked the island. Thats why I took the Ionian there two and a half tousand years ago.
a: ( ~river ) Do you see me moving the waves of river Golo?
a: ( ~town ) I think, the most beautiful town of the island is Bonifacio. A wonderful combination of cliff-line and lagoon.
a: ( ~history) Who do you think you are? Napoleon?

When concepts will be expanded (There are only 10 rivers in ~river now),
his would be much more precise than our first approach.

All the best

Andreas

P.S.: I am quite sure that there are some little faults for example in my code,
but I am too snow-blind inside of my text to see them. Please correct me!
But I had to put a blank in < pattern>, because without it, the whole word
couldn’t be seen.

 

 

 
  [ # 23 ]

what does the annotation tag do in aiml.

and what would you like me to do here for you?

 

 
  [ # 24 ]

There is no annotation tag in AIML and must be something Andreas has coded for his own system.

 

 
  [ # 25 ]

I thought I had posted this earlier this morning, but it seems that I only wrote it, and got called away before actually posting it:

I didn’t remember anything in AIML with regard to an <annotation> tag, so I re-read the specification, and went through the reference manual again, too. There’s no such animal in any version, from 0.9 to 1.0.1 - I don’t recall it being a custom tag for Pandorabots, either.

Most AIML interpreters should ignore the tag and it’s contents, provided it’s not within the bounds of either a <pattern> or <template> tag, but there may be issues, depending on how a given interpreter is written.

Translation of said tags, however, should be simple, since they’re nothing more than internal documentation, from what I can tell. Simply replace the </annotation> tag with a NewLine (\n) or a Windows Carriage Return/LineFeed (\r\n), and replace the <annotation> tag with the same, followed by #!, to transform it into a comment. A further, precautionary step can be performed, to remove any \n or \r\n from the enclosed text, and place it all on a single line (or to insert a #! after each found instance of a NewLine/CRLF) to make sure the resulting script doesn’t get broken.

My bad.

 

 
  [ # 26 ]

Hi Bruce,
hi all,

sorry for causing some confusion by mentioning a non-AIML-tag called <annotation>.
It comes from former new-tag-discussion for AIML.

What I wanted to propose Bruce is a possibility
to have annotations in ChatScript.

For example something like this:
u: (I like ~dictator §sympathy-level:-10 §ethical-level:-10)
Do you feel so weak that you need such a BIG DADDY?

A § instead of a $ would be read-only (like the <think>-tag)
and could hand out its results
to the “heart” or the “ethical centre” of the bot.

All the best

Andreas

 

 
  [ # 27 ]

Sorry, I’m not fully understanding…
§sympathy-level:-10
you say it’s read only and you say it hand out it results to the heart of the bot.

Are you saying:
1. the pattern will respond only if sympathy-level is -10
2. the pattern should temporarily set some sympathy-level to -10?

 

 
  [ # 28 ]

To 8PLA:
you asked:
So my question in plain language is, in ChatScript, is this (generally) legal?

‘can I do this’: ( yes ) You can do that.


If you are asking is that legal ChatScript, then no. The legal form is:
u: (*) can I do this
  a: (yes) You can do that.

 

 
  [ # 29 ]

Number 2:)

The annotation §sympathy-level,
perhaps §(heart)sympathy-level is even better
should hand over the value -10 to the “heart” of the bot.
By this, anger about the users output could be shown.

Im my MALDIX-concept,
there values from -10 to +10 are possible.

Andreas

P.S.: non-digit-annotations should be possible too,
like §(dialogue-manager)collocations:[great Chaplin Hitler Stalin]

 

 
  [ # 30 ]

so… why does this data need to be on the pattern side if it has nothing to do with detection?
you could just call functions on the output side, or do direct assignment.

 

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