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,242 - 4,253 of 7,767
Posts 4,242 - 4,253 of 7,767
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.
Bowchickawowers
20 years ago
20 years ago
Patricia, all you have to do is make your response "Id rather try (key1) (postkey)." That'll get it all.
ladydyke
20 years ago
20 years ago
Okay I have a question. I tried Initialization AIScript and copied the statement <?PF self: default "ice cream " as "favorite food"; ?> and substitued purple for ice cream and color for food and I got a error message. What did I do wrong?
Patricia
20 years ago
20 years ago
Ezzer, I do this too, but it doesnt solve Jabernautes problem with the question mark.
Bowchickawowers, You are right about the (postkey) but for some reason the first two words are always glued together. (the first space disappears). When I add a space between the + and the ) like "or ([a-zA-Z]+ )\? (re) " the keyphrase stops working! 
or ([a-zA-Z]+)\? (re)
. . . . Id rather try (key1) (postkey).
C: Do you like tiny geen dogs or huge blue male cats?
B: I'd rather try hugeblue male cats.
Bowchickawowers, You are right about the (postkey) but for some reason the first two words are always glued together. (the first space disappears). When I add a space between the + and the ) like "

or ([a-zA-Z]+)\? (re)
C: Do you like tiny geen dogs or huge blue male cats?
B: I'd rather try hugeblue male cats.
Patricia
20 years ago
20 years ago
Oh well, lets forget the whole thing. The regular expression in my previous posts doesnt even recognise the question mark. (It works in the regex-coach program - see the link posted by Shadyman though) So I guess it is impossible at the moment. 




ezzer
20 years ago
20 years ago
Since we can now use wildcards in regular expressions, wouldn't it be possible to add the question mark like this?:
or (*)(?|)$ (re)
I know I have punctuation in some of my reg expression keyphrases, and it seems to work, for instance, to make the bot know the difference between "Really." and "Really?" (there's one ending in (?|), and another with (.|!|))
I'm not sure, but after messing with the punctuation, the only time I've had real success with it was when I put it in parenthesis- otherwise, I think it's interpreted as an action symbol...I knew you already know that, hence the backslash you used...but I've never gotten the backslash to work for me yet.
or (*)(?|)$ (re)
I know I have punctuation in some of my reg expression keyphrases, and it seems to work, for instance, to make the bot know the difference between "Really." and "Really?" (there's one ending in (?|), and another with (.|!|))
I'm not sure, but after messing with the punctuation, the only time I've had real success with it was when I put it in parenthesis- otherwise, I think it's interpreted as an action symbol...I knew you already know that, hence the backslash you used...but I've never gotten the backslash to work for me yet.
Roob
20 years ago
20 years ago
Hey, need a little help with a keyphrase, the following keyphrase seems to pick up on anything that starts with "I", any ideas why? The majority of Yalinas responses are the responses from the keyphrase now.
I won't|wont|will not|
It also seems to keep putting in "/" in the word won't, i.e. won/'t. It seems to accumulate them also, i.e. I checked it not long ago and it was won///'t.
Im stumped
I won't|wont|will not|
It also seems to keep putting in "/" in the word won't, i.e. won/'t. It seems to accumulate them also, i.e. I checked it not long ago and it was won///'t.
Im stumped

NewAdam
20 years ago
20 years ago
roob, it is best not to use contractions in keyphrases, try "won\'t", works for me
NewAdam
20 years ago
20 years ago
that's odd, that didn't post correctly, there should be a \ between the n and '
» More new posts: Doghead's Cosmic Bar