AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Coding for Grammar: Switching “person”
 
 
  [ # 16 ]

I solved this mostly by splitting the problem in 2. first, I convert all of ‘I’, ‘me’,‘my’, ‘mine’, ... to ‘I’ + it’s form (agent, object, article,..). I do the same for ‘you’, ‘your,... to ‘you’+...
Then, the transformation becomes as simple as switching I <-> you. During the output, I convert the ‘I’ and ‘you’ back to it’s correct form, according to the position in the sentence. The last part is still a bit buggy (especially with respect to verb conjugations, but that’s just a matter of going through the code and fixing the bugs, pfff).

 

 
  [ # 17 ]

It seems that there are more “exceptions” to the “I/me” problem than there are examples. I’m finding that, for the most part, if the word following “you” is a verb, then it translates to “I”, rather than “me”. Now, all I need is a list of common verbs, along with their 2nd and 3rd person forms. Then it’ll be simple, I think, to make the necessary transformations. It looks like WordNet (or some other ontology) is going to be a part of Morti sooner than I had thought. raspberry

 

 
  [ # 18 ]
Dave Morton - Feb 28, 2011:

I think that the “I/me” scenario will be rather rare.

I don’t know, from my experience it seems somewhat common, although I can’t think of a lot of examples off-hand. If you ask an unaltered AIML bot:

Human: What would you do if you were me?
you’ll get:
Bot: I will let you know when I become a you.

Human: Was I at your party?
you’ll get:
Bot: it might have been.

Human: Would you say I am unbalanced?
you’ll get:
Bot: I could say it. OK. “You am unbalanced.”.

Human: I am afraid I think you can.
you (could because of a random answer) get:
Bot: Not literally afraid, right? Me? Why would I think you can.

The issue is exacerbated, at least in part, by non-native English speakers, who have an odd way of forming a sentence or question, but more often than not, when I trace the IP associated with the chat log, I find it’s someone living within a few miles from where I live… someone who can’t sign their name unless they’re using a can of spray paint.

 

 
  [ # 19 ]

The whole point of this exercise is to make Morti better that the average AIML bot. smile Therein, they say, lies the challenge (or was it “madness”? I can never really tell, anymore)!

I found a list of 300+ verbs, but without “person” modifiers, so I’m using what little common sense I have left to me to alter the list to suit my needs. I have something like 74 lines altered. Only 256 lines to go. gulp

 

 
  [ # 20 ]

Dave,

Yes, a good bot needs half decent grammar mastery on both input end, language understanding -and- language synthesis.  On a some what related issue, I had a funny problem with a (simple) bot I wrote back in the early 2000’s.  It used templates, and when a variable was filled by the word “you”, it didn’t know that in some cases, it should translate ‘you’ to ‘me’ (or ‘me’ to ‘you’).  Example if I’d enter ‘You are intelligent’ , responding with ‘Yes, I am intelligent’.  But when it was an expression, I don’t know, like ‘You never can tell’, it should know not to translate that ‘you’ to ‘me’ or ‘I’.  Expressions were a problem that way.  It is a non issue now since my current design has no templates at all.

 

 
  [ # 21 ]

I think Morti will probably be “stuck” with templates for a while yet, but there’s nothing to keep me from having him more intelligently determine which template to use. smile I think, though, that this marks a definite step (albeit a small one) forward in Morti’s evolution. smile

 

 
  [ # 22 ]

Well, back when I was still working on that bot, I decided that if it was going to use templates, that I would simply not have a template where a variable would match with ‘you’.  ‘You’ would only be allowed to be a constant in any expression.  So if input was “Bob talked to you” and two possible templates to match (noun) (ptverb) to (object), and another “(noun) (ptverb) to you”, it matched with the second (based on fact that two variables were matched, (less than 3 which would be case of first template).  That -basically- worked.  So templates are central in both NLU and NLG in Morti?  I’m probably going to go with templates for NLG, for now.

 

 
  [ # 23 ]

Given the very nature of Morti’s input/response architecture, I don’t think there’s anything “natural” about it, especially since it’s me who is scripting the responses. smile After all, how many people do you know who greet you with the fervent wish that “the flying monkeys never come after your dog”?

 

 
  [ # 24 ]

My two (separate but equivalent) Mentifex AI chatbot programs, http://code.google.com/p/mindforth in Forth and http://www.scn.org/~mentifex/AiMind.html in JavaScript for Microsoft Internet Explorer (MSIE), solve the “switching person” problem in an extremely radical way. In the Mentifex AI Minds, all words are conceptualized in accordance with the http://mind.sourceforge.net/theory5.html Theory of Mind for AI. Therefore, the various personal pronouns are also conceptualized. The radical part of my design is that in some ways the personal pronoun “tail” is wagging the dog, so to speak. By this paraphrase I mean that the AI Mind structure contains two special flags, “fex” and “fin”, which exist chiefly to handle the “switching person” problem but which necessarily exist for the vast majority of other concepts which are not even involved in the “switching person” problem. The flag “fex” stands for “fiber out” and the flag “fin” stands for “fiber in”. These flags “fex” and “fin” are two flags in an eight-flag “panel” of flags stored for each engram of a concept.

When the Mentifex AI Mind receives and recognizes the word “you” as input, the fiber-in “fin” flag causes the AI software to activate the “I” self-concept of the artificial intelligence. Likewise, when the AI Mind is thinking, it refers to itself as “I” for a subject and as “me” for a direct object. It is complex, but it works.

 

 
  [ # 25 ]

That’s an interesting way to handle the challenge, Arthur. But since Morti is still (at this point) an AIML bot at heart, I think it would be somewhat difficult to implement.

I’ve created a page to test my person function at http://www.geekcavecreations.com/Morti/personTest.php. It has a simple form to allow you to put in any phrase or sentence you like, to test the transformations from first to second person, and second to first. I invite and encourage everyone to give it a try. The page creates a log of the original input, and the transformed output, so if there are errors in the transformations, I can see them, and make corrections.

Currently, the script checks against 2,147 different verbs and adverbs, in either present or past tense. I think that should cover the vast majority of situations. smile

 

 
  [ # 26 ]

Seems to need “I am” correcting there Dave.

I just tried “I am alive” and “You can see that I am in awe of you”. and got the dreaded “you am”.

 

 
  [ # 27 ]

Keep up the good work, Dave.  It’s getting harder and harder to trip-up Morti.  So far, I’ve just located a couple more.

Test phrase = “What can I do to help you make changes?”
Output phrase - “What can you do to help I make changes?”

Test phrase = “Who am I without you?”
Output phrase - “Who am you without me?”

 

 
  [ # 28 ]

A couple more:

Test phrase = “How are you today?”
Output phrase - “How are me today?”

Test phrase = “How were you last week.”
Output phrase - “How were I last week.”

 

 
  [ # 29 ]

Thanks, everyone. This was most helpful.

@ Steve: It’s odd that that one cropped up, because “I am”, “you are”, “s/he is” is in there, in the verb list. I ended up having to add it in the “simple” transforms, to make it work. Odd.

@Thunder & Merlin: Your samples just pointed out that I need to take not only pronoun/verb pairs into account, but also verb/pronoun pairs, as well.

I guess it’s back to the drawing board. smile Good stuff, folks! Thanks again.

 

 
  [ # 30 ]

I’ve taken care of the above examples, plus a few others that popped up, too. Thank you all for your help. With a bit more testing, I think this new function will prove useful to Morti’s advancement. smile

 

 < 1 2 3 > 
2 of 3
 
  login or register to react