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
Posts 4,233 - 4,244 of 7,767
Shadyman
20 years ago
20 years ago
Ooh this thing makes regular expressions for you!
http://www.weitz.de/regex-coach/
http://www.weitz.de/regex-coach/
dallymo
20 years ago
20 years ago
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?
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?
Patricia
20 years ago
20 years ago
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 Im going to try these plug-ins again.
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 Im going to try these plug-ins again.
ezzer
20 years ago
20 years ago
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?"
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?"
dallymo
20 years ago
20 years ago
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.
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.
Shadyman
20 years ago
20 years ago
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
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

jabernaute
20 years ago
20 years ago
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.
ezzer
20 years ago
20 years ago
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.
Patricia
20 years ago
20 years ago
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 jabernautes 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)
. . . . . Id rather try (key1).
C: Do you prefer green dogs or blue cats?
B: Id rather try green.
C: Shall we go to a movie or have dinner?
B: Id rather try have.
Does somebody has a bright idea to enable bots to recognise this kind of question and do something useful with it?
Two things stopped my keyphrases from working:
I could only specify the second term:
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!
Again, the shortcut for white spaces \\s is not recognised.
Example responses:
or ([a-zA-Z]+)\\? (re)
C: Do you prefer green dogs or blue cats?
B: Id rather try green.
C: Shall we go to a movie or have dinner?
B: Id rather try have.
Does somebody has a bright idea to enable bots to recognise this kind of question and do something useful with it?
ezzer
20 years ago
20 years ago
I just use a wildcard after the word or, and refer to (key1) and (prekey) in the response, pretty much.
» More new posts: Doghead's Cosmic Bar