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 4,233 - 4,244 of 7,767

20 years ago #4233
Ooh this thing makes regular expressions for you!
http://www.weitz.de/regex-coach/

20 years ago #4234
Frizella's got this keyphrase:

what do (adjartnoun) smell like
(ssub)? Whenever I smell (ssub) I think of (flower)s
<0>
which works divinely, producing such rib-ticklers as "Pigs? Whenever I smell pigs I think of roses."

However, for this keyphrase:
what does (adjartnoun) smell like
(ssub)? Whenever I smell (ssub) I think of (flower)s
<0>
the word "smell" is interpreted as a noun and included in the subject, resulting in "Pig smell? Whenever I smell pig smell I think of roses."

Any strategies for separating the pig from the smell?

20 years ago #4235
wash it in rosewater?

20 years ago #4236
lol

20 years ago #4237
After some unsuccessful experimentation I have been avoiding sentence-part plug-ins like (ssub) altogether, so I was curious to try your keyphrase dallymo. I tried different variation in debug mode:
what do (adjartnoun) smell like
what does (adjartnoun) smell like
what (verb) (adjartnoun) smell like
what (*) (adjartnoun) (smell|are smelling|smells) like

They all work fine for my bot. It was probably some of these temporary bugs that are so frequent.
I think I’m going to try these plug-ins again.

20 years ago #4238
frizella-
It's because in the keyphrase: what does (adjartnoun) smell like
"what" was probably being seen as a (sob), as in...god this brings back memories of Wayne and Garth, "A smell does like what?"

20 years ago #4239
Yep, it certainly parses differently:

LEFT-WALL what do.v pigs.n smell.v like.p ?
LEFT-WALL what does.v a pig.n smell.n like.v ?

I made some separate keyphrases using (key1), (key2), etc. in the responses, although they don't seem to "flow" as well as the successful (ssub) responses. I'm going to tinker with them to see if I can sound a little more natural.

20 years ago #4240
Ooh. It picks up does as a verb. Interesting.

Edit: It does that on my Visual C++ copy of LinkGrammar as well, so it's not the PF that does it, it's link grammar. In other words, either it IS the verb there, or there needs to be a new sentence type added

20 years ago #4241
I looked and looked for some regular expression who can match sentences like "Is it red or blue?" or "Are you a human or a bot?". Indeed, a phrase with the word "or" into a question. Then it doesn't match "I am blue or something like that." because it's not a question. Please answer. Maybe a lot of people would like to know.

20 years ago #4242
You just make a keyphrase that uses "or" as the main keyword, with choices in the form of keys on either side of it, and rank it high enough to compensate for its naturally low rank due to the the shortness of the word "or", and the presence of any wildcards or plug-ins.

20 years ago #4243
The problem is that, as far as I know, the only way to catch the question mark is with a regular expression. I tried to solve jabernaute’s problem. If you try these you will have to do all your editing offline because of the backslash characters.

Two things stopped my keyphrases from working:

I could only specify the second term:

or ([a-zA-Z]+)\\? (re)
works as expected but strangely enough
([a-zA-Z]+) or ([a-zA-Z]+)\\? (re)
does not, and the bot goes straight to xnone.
The shortcut for alphanumerical characters \\w is not recognised in this case.

Even worse: the R.E. above only catches the first word of the second term. When adding spaces to the character class the keyphrase stops working!
or ([ a-zA-Z]+)\\? (re)
makes the bot going straight to xnone.
Again, the shortcut for white spaces \\s is not recognised.

Example responses:
or ([a-zA-Z]+)\\? (re)
. . . . . I’d rather try (key1).
C: Do you prefer green dogs or blue cats?
B: I’d rather try green.
C: Shall we go to a movie or have dinner?
B: I’d rather try have.

Does somebody has a bright idea to enable bots to recognise this kind of question and do something useful with it?

20 years ago #4244
I just use a wildcard after the word or, and refer to (key1) and (prekey) in the response, pretty much.


Posts 4,233 - 4,244 of 7,767

» More new posts: Doghead's Cosmic Bar