The AI Engine

This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.

Posts 6,537 - 6,548 of 7,766

16 years ago #6537
I will try to get used to using the correct format, in the mean time I have come up with a far more elegant option:
why not just use the catch all (*) as a seek to where the user would want to store the response as a memory.
?pf rem (key1) as "wholesentence"; ?
On the other hand, I certainly will try and test your examples above and build on that.

16 years ago #6538
Anybody knows why:
KP:
(do|) (have|) you (have|) * (thingsihave62290) [5,0] <?PF remember (key5) as "ihave"; ?>

Answer:
Yes I have a (key5) <?PF if (mem-ihave) is not (key5); ?>

results in the import process in a syntax error for the answer:
ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is not (key5)" ????

Thanks

16 years ago #6539
I believe the problem is the AI script if (mem-I have) is not (key5). The memory value is not really (key5) is is going to be something that is listed in you inner life under (mem-Ihave)
What ever (key5) was is not listed, like I have a goat. The memory value is now 'a goat' not (key5)

16 years ago #6540
I always thought the engine doesn't allow for (keys) beyond (key3) other than (postkey). It would open up a new world of key phrases and responses if it does.

16 years ago #6541
It would look like this
(do|) (have|) you (have|) * (thingsihave62290) [5,0] <?PF remember (key5) as "ihave"; ?>
I have a goat
Yes I have a goat

The memory of (Ihave) is now goat
<?PF if (mem-Ihave) is not "a goat"; ?>
by having the if not a 'goat' in the AI script you have invalidated the keyphrase.

16 years ago #6542
I think LarsB is right I seem to remember the top limit is 4, but I will check.

16 years ago #6543
Provided that the (key5) thing works then the key phrase
(do|) (have|) you (have|) * (thingsihave62290) [5,0] <?PF remember (key5) as "ihave"; ?> will only be triggered if the Private plug-in (thingsihave62290) contains "goat".


16 years ago #6544
I think LarsB is right I seem to remember the top limit is 4, but I will check.

I have some (key5)s and (key6)s that work in bible searches and quadratic equation solving - I wasn't aware there was a limit (certainly I recall no limit mentioned in the book of AI.)

They get a little unreliable occasionally, but they're certainly working now - just ask BJ "what's x when 3 x squared plus 2 x minus 1 equals zero?<0>"

That's a 5-key match, all 5 of which are passed out to the external script for processing (and so can be assumed to be handled properly - my calculator gives me the same solution):

([1234567890]+) x squared (plus| +) ([1234567890]+) x (minus| -) ([1234567890]+) (re)<0>

likewise "first book of Maccabees 12 verses 1 to 5<0>"
matches the keyphrase:

(First|First book of) (Maccabees|Macabees) ([1234567890]+) (verse|verses) ([1234567890]+) to ([1234567890]+) (re)<0>

6 keys, of which 5 - (key1)(key2)(key3)(key5)(key6) - are actively used in the search, and are handled competently (at least the result matches my printed version )

No, AFAIK there's no limit - but has anyone ever tried a (key7)?

16 years ago #6545
Anybody knows why:
KP:
(do|) (have|) you (have|) * (thingsihave62290) [5,0] <?PF remember (key5) as "ihave"; ?>

Don't use a soft wildcard, and the optional plugins are bad juju too. If someone says "you have a goat", "have" is (key1), "a" is (key2), the value found in (thingsihave62290) (presumably "goat") is (key3)

If (heaven forfend) they said "do have you have a goat", then "goat" would be (key5). But if they said "do have you a goat", it would be (key4). In this case such ungrammatical outbursts are unlikely, but in other cases they may not be.

if they said "you goat!", or "you old goat!", then it would match, and "goat" would be (key1) or (key2). Unused plugins or wildcards do not count as keys - where there's no match, the parser can't assign them a value, so they're ignored.

You really need to fix the (key) structure so it can't possibly be altered. No soft wildcards, no optional plugins (ending "|"). I'd rewrite it:

(do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key5) as "ihave"; ?>

Then whatever matches in (thingsihave62290) will ALWAYS be (key3)

16 years ago #6546
I've also used (key5) and (key6), and they seem to work.

16 years ago #6547
Well, new things to be learned each day, I remember trying to get (key4) in AIscript to store as a memory about 18 months ago and it didn't seem to work, might have been my poorer understanding of the whole thing back then and never really thought about it again until marco3b mentioned and Psimagus explained it today.

16 years ago #6548
Trying to get (key7) to work on of the test bots, it went straight to my private(xnone):

You: but has anyone ever tried a (key7)?
Bot: Are you talking to me?


Posts 6,537 - 6,548 of 7,766

» More new posts: Doghead's Cosmic Bar