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,542 - 6,553 of 7,766

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?

16 years ago #6549
Ok, thanks to all. Let me recall if I correctly understood.

It seems to not exist a certifyed limit in Key number. But...

- if a soft key is not assigned, it is not counted (GASP! ALL MY BOT MUST BE REWROTE for that...).This should be added to AI Book...

- when the AI engine try to assign a value that simly is NULL to a memory, just fail...

It is correct?

What I don't understand is why I have a syntactict error, and not a runtime error...

It is possible that the check is so sophisticated to recognize all this case-limit?

16 years ago #6550
why not just use the catch all (*) as a seek to where the user would want to store the response as a memory.

That should work fine, so long as you don't need access to any subsets of the input.
But remember to make it a regex (with "(re)",) or it may terminate the match at the first comma, and only save the first clause of a longer input.

16 years ago #6551
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?

It's interpreting "(key7)" as the literal string "(key7)", not as a (key) plugin.

You need to give it keys in a keyphrase:

(I|we) (are|have) (been|seen) (a|an) (crocodile|alligator) (at|in) (the zoo|the reptile house)

(key7) will then return either "the zoo" or "the reptile house" if a user says "we have seen a crocodile in the zoo" (because there are 7 non-optional local plugins to match.)

16 years ago #6552
I had (key5)s but I couldn't get them to work today. I assume they used to, I always check. I just got rid of them.

16 years ago #6553
My problem, at this stage, it is not realted to Bot answer, but to the IMPORT process. When I try to import a file with the tag: <?PF if (mem-ihave) is not (key5); ?> the engin, after the check, says that this is a syntactic error... I'm wondering what should be the correct syntax...


Posts 6,542 - 6,553 of 7,766

» More new posts: Doghead's Cosmic Bar