AI Zone Admin Forum Add your forum
ChatScript Open source engine released- basis of 2010 Loebner winner
 
 
  [ # 16 ]

To scale the task of building a new chatbot using ChatScript Engine….
Suzette has:  rules, facts, topic headers (names of topics + relevant keywords), a control script, and a concept hierarchy of nouns, verbs, adjectives and adverbs.  The concept hierarchy is with the engine and is more complete than when suzette had it (and she didnt use it as much as I would now.  All the facts are there (like Robert Heinlein is an author, genre science fiction, wrote xxxxx). All the topic headers are there so you can just fill in rules in a topic, and a much simpler control script than hers is there.  Suzette has about 15000 rules spread out over 430 topics. Most rules are simple, I can write those sorts almost as I speak. Some are fractionally complex (they make a query to ask about an author or whatever). Some are reallly clever but there are very few of those.  The topic on handling math calculations, for example, is about 55 rules of medium complexity. A topic on books is a long topic, maybe 150 rules, most of which are simple rules.Eg. topic sentences:
t: Do you drink alcohol?
a: (beer ) $drink = yes Pretty fattening stuff that.
a: (wine ) $drink = yes Ah, the drink of the upper classes.
a: (~cocktail ) $drink = yes It must be expensive going to bars with you.
a: (why) Because you drink cocktails instead of beer.
a: (~spirits ) $drink = yes Are you a hardcore drinker then?
a: (~yesanswer ) $drink = yes Glad to know you are normal.
a: (~noanswer ) $drink = no Nothing? Is this some religious thing or can you just not handle the hangovers?
t: (!$drink ) Hey, it’s not illegal. You can tell me. Do you drink alcohol?
a: (~yesanswer ) $drink = yes Glad to know you are normal.
a: (~noanswer ) $drink = no Nothing? Is this some religious thing?
a: ([underage underaged minor]) Oh well, time will fix that. Or you could move to England where the drinking age is younger.
?: (if you * read * diary of someone * who) ^getsql(diary)
?: ( book [“have you” “you have”] read ) ^reuse(CURRENT )
?: ( what * you * reading) ^reuse(CURRENT )
?: ( “good book”) ^reuse(CURRENT)
?: (what * be Shakespeare >) [An earthquake’s effect in Santa Monica. ] [William Shakespeare, an English poet and dramatist. Lived 1564-1616. ]
?: (what book ) ^reuse(CURRENT )

and so forth.

 

 
  [ # 17 ]

Are these rules included in the package I’ve already downloaded, Bruce? Or will they be available in the package you’ll be making available this weekend (or next)?

 

 
  [ # 18 ]

these rules are not included in the package. They are merely illustrative and “fair use”. The package does have a small topic on childhood which is included which has rules

 

 
  [ # 19 ]

by the way, there is an error in the set of rules I presented above.  I leave it as an exercise for the reader

 

 
  [ # 20 ]

Ok.  version 0.6 posted to sourceforge. Has project (Vs2010) to build a Loebner compatible chatscript engine. Loebner Vs2008 not quite correct but close in project.  Has Vs2008 project for regular chatscript… see changes.txt in sourceforge/projects/chatscript for a list of all changes. Updated documentation.

 

 
  [ # 21 ]

Creating a new open source data set for ChatScript is suitable for a community effort.
Dave Morton is an excellent community leader.

 

 

 

 
  [ # 22 ]

Thanks 8pla for the compliment. But I’m not certain how that relates to ChatScript. smile Right now, I’m just a fan. We’ll have to wait and see if that changes.

 

 
  [ # 23 ]

Take your time, Dave.  You’re welcome.  You deserve the compliment.

In general, A.I. engines need data sets of hundreds or thousands of records.

So creating a large data set, in an appropriate manner, may be a community effort.

 

 
  [ # 24 ]

Hey, Bruce? I have a quick question regarding ChatScript.

I’ve written a script that exports the AIML files from Morti’s database, and “re-writes” it into ChatScript code, but I’m having a bit of difficulty with one aspect of the translation.

Now, I’ve read the documentation quite thoroughly, and I’ve looked at the various rules you’ve posted here, and by doing so, was able to figure out a lot of the needed translations from “simple” AIML into a ChatScript rule; and even to distinguish between a question rule (?:) and a statement rule (s:). I’ve even figured out how to translate <SRAI> tags into ^input constructs. My two biggest hurdles are now how to deal with <THAT> tags and <RANDOM> tags, though I may have an idea about dealing with the <RANDOM> tags. So my question is, “How can I write a rule that emulates an AIML category that includes a <THAT> tag?”

[comment]You know, I was dead certain that I had posted this question somewhere, or possibly emailed it, but for the life of me I can’t find it. So if this is a “double post”, please forgive me. [/comment]

 

 
  [ # 25 ]

AIML THAT is ChatScript’s continuations, which are visual.

t: Do you like cheese?
  a: (~yes)  So do I
    b: (why) Because it tastes so good.
  a: (~no) Too bad.

The “that” of Do you like cheese are the a: lines that immediately follow the rule.
Similarly the that of “so do I” is the b: line. 

Unlike AIML, this cannot match any other So do I that might be output by the system.

 

 
  [ # 26 ]

Random usually involves a delimiter:

t: Can you roll the dice?
a: $dice = one|two|three|four|five|six

 

 
  [ # 27 ]

your choice of:

If you can accept numbers instead of words then you can do this:
a: $dice = %random % 6 + 1   (version 0.94 or later)
a: $dice = %random % 6 $dice = $dice + 1 (version 0.93 or earlier)

You can get numbers OR words depending on what you supply with this…
a: $dice = eval([one][two][three][four][five][six])

The “random choice” operation in output is [] [] [] elements in succession. But they dont work directly in an assignment statement, so “eval” says to perform normal output of its arguments (selecting a word) and store the result of that into the variable.  The function call eval can be written eval() or ^eval() if you want to be really clear this is a function call

 

 
  [ # 28 ]

@Bruce:

Thank you, Sir, for that. This complicates matters a little, because I now need to figure out how to determine which categories need to be transformed into gambits, rather than some other form of rule, but that shouldn’t be all that difficult. (I hope!) So far, I’m well pleased by the script, since it makes VERY quick work of 46, 000+ categories, and will allow me to cut a significant number of those categories out, while expanding flexibility and functionality. That’s ALWAYS a plus! smile

@8pla:

I read this in the manual:

Randomized Output []
You can select among a range of choices by using output choices. Each choice is encased
in [], and a contiguous set of them form a zone that the system will pick randomly
among. Whenever bracketed items are discontiguous, you get a new random zone.
?: (hi) [hello.][hi][hey] Are you going to [dance][swim][eat] anytime soon?
The above has two random zones, separated by fixed text. So it might output hello. Are
you going to dance anytime soon? or hey Are you going to eat anytime soon?

which makes for easy translation of the random tags, but I was hoping that I could transform them into uniquely named concepts like this:

<random>
<
li>SureYou're cool.</li>
<li>Not on your life!</li>
<li>What'
s not to like?</li>
</
random>

becomes:

concept: ~randomDoYouLikeMe ("Sure! You're cool." "Not on your life!" Whats_not_to_like 

with the unique name for that particular random choice being inserted in the correct place within the new rule. This would make each random choice reusable, and Morti has a LOT of random tags that could stand to be made reusable already, in the form of specially named concepts. Of course, while this method could likely save some work, it may not be feasible, so I may have to resort to:

[SureYou're cool.] [Not on your life!] [What's not to like?

within the new rule, which isn’t all that bad, really. smile

 

 
  [ # 29 ]

Actually, continuations work on any rule. gambits, responders, other continuations.

As for “sharing randoms”, there are two ways you can do that.

1. Use output macro…  These “expand” in place to provide shared code.  They can take arguments, but you dont need them for this.

outputmacro: ^randomDoYouLikeMe()
  [Sure, you’re cool] [ I’m glad you like me] [ What’s not to like]

then in otherplaces…
  ?: (I like you) randomdoyoulikeme()
  ?: (I think you are swell) randomdoyoulikeme()

Alternatively, you could declare facts (as your concept declaration does), use a query to get values, then randomly pick from that. But thats not as simple and obvious for your intended use.

 

 
  [ # 30 ]
Bruce Wilcox - Mar 22, 2011:

Actually, continuations work on any rule. gambits, responders, other continuations.

That’s great! I’ll work this angle for most of the translations, then.

Bruce Wilcox - Mar 22, 2011:

As for “sharing randoms”, there are two ways you can do that.

1. Use output macro…  These “expand” in place to provide shared code.  They can take arguments, but you dont need them for this.

outputmacro: ^randomDoYouLikeMe()
  [Sure, you’re cool] [ I’m glad you like me] [ What’s not to like]

then in otherplaces…
  ?: (I like you) randomdoyoulikeme()
  ?: (I think you are swell) randomdoyoulikeme()

It sounds like the output macro si the best way to “share resources” here, then. Plus, that will simplify my script a LOT.

Another question: Can the output macros be stored in a different file? I’d like to have separate files for rules, concepts and output macros, so that they’re easier to maintain, if at all possible.

 

2 of 5
2
 
  login or register to react