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..

Example statements
 
 

Hi guys,
I’m currently testing the handling of complex statements. To make certain that I don’t get stuck in my own limiting view of English, I’m looking for some short, but tricky (or what you see as tricky) complex statement examples.
Ex: I’ve been testing with statements like: I have 2 hands and a hand has 2 fingers.
It’s short, but the tricky bit here is the ‘2 hands and a hand’. Basically it translates to:
(Agent-have-object)-conjunction-(agent-have-object).
I’m mostly trying to test if I have put the right filters at the correct levels.

 

 
  [ # 1 ]

Hi Jan,

I see you are still very hard at work on your project also.

Yes, that is a fairly complex sentence for your bot at this stage, (still being I assume in its ‘early childhood’—mine is not technically ‘born’ yet ... hoping to be done the engine which will power it by end of Feb ‘11)

                  I have 2 hands and a hand has 2 fingers.

So you are demonstrating a compound sentence made up of two simple sentences

                    simple sentence 1 ‘I have 2 hands’
                    simple-sentence 2 ‘a hand has 2 fingers’

coordinate conjunction here is ‘and’

both sentences have 1 predicate,  sentence 1’s predicate being ‘have 2 hands’, sentence 2’s predicate being ‘has 2 fingers.

I’m assuming you also support conjunctions not only between 2 sentences of a compound sentence, but also between adjective modifiers of the direct objects, and the direct objects themselves?  Example :  ‘I have 2 hands, 2 feet, 2 eyes, and one nose’.

 

 
  [ # 2 ]

How about “I have two hands and five fingers on a hand.”? Or (almost) similarly, “I have two lunch bags and a laptop in a bag.” Okay, so now we’re into contextual territory. And the second sentece is vague even if you knew exactly what all three objects are (lunch bag, laptop, bag). But how would your parser handle these sentences? Would it recognize that the “lunch bag” is not the same as the “bag”? Using articles as context clues or otherwise? What context clues does your parser use to decide how to split up complex sentences?

Okay, let me try and think of a context-free case. How about, “The dog chased the cat around the corner and up a tree.” In this case, the key is to use parallel grammar (prepositional phrases) to deduce how to break up the sentence. Something we do without thinking, but definitely has to be well-programmed into a bot…

 

 
  [ # 3 ]

The example of hands and fingers reminded me of a paper by Marvin Minsky from 1967: http://rafael_es_son.typepad.com/metainformaciones/files/minsky_essay_1967.pdf

The following dialog doesn’t deal with compound statements per se, but includes statements about hands and fingers:

> EVERY BOY IS A PERSON
(I UNDERSTAND)
> A FINGER IS PART OF A HAND
(I UNDERSTAND)
> EACH PERSON HAS TWO HANDS
(THE ABOVE SENTENCE IS AMBIGUOUS PLEASE REPHRASE IT)
> THERE ARE TWO HANDS ON EACH PERSON
(I UNDERSTAND)
> HOW MANY FINGERS DOES JOHN HAVE?
(I DON’T KNOW WHETHER FINGER IS PART OF JOHN)
> JOHN IS A BOY
(I UNDERSTAND)
> HOW MANY FINGERS DOES JOHN HAVE?
(HOW MANY FINGERS PER HAND?)
> EVERY HAND HAS 5 FINGERS
(I UNDERSTAND)
> HOW MANY FINGERS DOES JOHN HAVE?
(THE ANSWER IS 10)

It’s kind of funny and a little sad that over 40 years later we’re still trying to solve these problems. Why aren’t there libraries to handle this, as there are graphics libraries, etc.? I guess it’s up to us to create them.

 

 
  [ # 4 ]

Warning: long post:  tongue laugh
Thanks everyone, this helped to get out of the box. It made some ‘problem areas’ visible.

(still being I assume in its ‘early childhood’

Yes, definitely an infant, perhaps still even ‘crowning’ (...picture it,....LOL)

I’m assuming you also support conjunctions not only between 2 sentences of a compound sentence, but also between adjective modifiers of the direct objects, and the direct objects themselves?

Yes, I am. The tricky bit is to put the correct filters at the correct levels, which is not so easy. The question was (and is): can I find some trick to filter it out in the grammar-parsing stage (like I am doing for the word ‘you’ as in: ‘you are you’), or do I need to generate all possibilities and do it all in the semantic-parsing stage, which can be very costly.
Here are 2 statements I came up with after reading the replies and which I think are tricky:
      Your brother and I love you.
I am your brother and I love you.

I am pretty certain that I have a few filters to many to get the 1st statement through the grammar stage. Though, the same filters are currently helping to get the second statement parsed really fast.

How about “I have two hands and five fingers on a hand.”? Or (almost) similarly, “I have two lunch bags and a laptop in a bag.” Okay, so now we’re into contextual territory. And the second sentece is vague even if you knew exactly what all three objects are (lunch bag, laptop, bag). But how would your parser handle these sentences? Would it recognize that the “lunch bag” is not the same as the “bag”? Using articles as context clues or otherwise? What context clues does your parser use to decide how to split up complex sentences?

Those are 2 good examples, which makes me rethink on another algorithm that I had previously discarded.
With respect to the ‘bags’: I make a difference between ‘abstract’ and ‘concrete’. So I would make 2 concrete assets that reference the same abstract object ‘bag’ (= a container made out of a bendable material?). Now, the first has ‘lunch’ in front of it, so this can be used as a filter to search through the existing assets of ‘I’. If non is found, a new asset is generated, together with a remark that this was not yet ‘known’. (Note that the ‘filter-on-lunch is still in writing stage, creating new assets has been in there from the start)
Secondly, an ‘abstract object’ can have ‘frame definitions’ (a sort of template) which defines the different forms that a word can be used in a sentence and what other parts should be found.  (Note: again this is also new in the next version). here’s a preliminary screen-shot for the word ‘similar’ .After each definition, some neural code can be attached to overwrite default behaviour.
The same system of ‘frames’ is used, by the way, to translate the grammar-parse to the semantic-parse. It’s at this stage that the possible sub statements within the input are recognized.
Just one question, cause it’s confusing for me too: do you have a laptop in a bag, and 2 lunch bags separately, or are they in the laptop bag? Perhaps a rule here could be: when the ‘noun’ of the final object (as in: on a hand), is the same as the first object (as in: two hands), then the bit after ‘and’ needs to be handled as a new statement: ‘a hand has 5 fingers’. When they are different, a question needs to be asked to figure out what to do, when there are no frames to guide?

 

 
  [ # 5 ]

@Robert: Perhaps you should take a look at my site. If you are looking for a library to handle be and have- relationships, a license is always negotiable.

 

 
  [ # 6 ]

Those are 2 good examples, which makes me rethink on another algorithm that I had previously discarded.
With respect to the ‘bags’: I make a difference between ‘abstract’ and ‘concrete’. So I would make 2 concrete assets that reference the same abstract object ‘bag’ (= a container made out of a bendable material?).

Ah, so you invoke specific instances (‘concrete assets’) of a known word (‘abstract object’)? So then it would be up to the bot to decide whether the two bags are the same instance of ‘bag’ or refer to different instances.

Now, the first has ‘lunch’ in front of it, so this can be used as a filter to search through the existing assets of ‘I’. If non is found, a new asset is generated, together with a remark that this was not yet ‘known’. (Note that the ‘filter-on-lunch is still in writing stage, creating new assets has been in there from the start)

Does your bot store in the long term the fact that ‘I’ has, for example, ‘lunch bags’, or is this some form of ‘short term’ memory about the current conversation? It would be bad if the bot always thought the user had lunch bags, but it would be useful to remember that users are able to have lunch bags.

Secondly, an ‘abstract object’ can have ‘frame definitions’ (a sort of template) which defines the different forms that a word can be used in a sentence and what other parts should be found.  (Note: again this is also new in the next version). here’s a preliminary screen-shot for the word ‘similar’ .After each definition, some neural code can be attached to overwrite default behaviour.

I was a bit confused by your screenshot. So are these templates designed to help the bot flag certain phrases that can be parsed with specific algorithms or…?

Just one question, cause it’s confusing for me too: do you have a laptop in a bag, and 2 lunch bags separately, or are they in the laptop bag? Perhaps a rule here could be: when the ‘noun’ of the final object (as in: on a hand), is the same as the first object (as in: two hands), then the bit after ‘and’ needs to be handled as a new statement: ‘a hand has 5 fingers’. When they are different, a question needs to be asked to figure out what to do, when there are no frames to guide?

Well, I meant that the lunch bags and the laptop are all in a bag. Thus the sentence is interpreted differently from the previous one (there aren’t two hands and five fingers on a hand!). However, as I said, this sentence is ambiguous even if you know what lunch bags, laptops, and bags are. So not the best example sentence then. smile

 

 
  [ # 7 ]

Does your bot store in the long term the fact that ‘I’ has, for example, ‘lunch bags’, or is this some form of ‘short term’ memory about the current conversation? It would be bad if the bot always thought the user had lunch bags, but it would be useful to remember that users are able to have lunch bags.

Yes and no. It stores in the long term memory the fact that ‘you’ (in specific-the concrete) have a lunch bag. The problem is, that the system doesn’t yet always recall a person correctly. When you say: ‘I am Jan’, it should start looking for a person called ‘jan’, but it only does this at the moment if you would say something like ‘Jan has a hand’. Some work is still required for this.
Deducing the fact that ‘every person can have a lunch bag’ is a next step (no code has been written for this yet, only ideas).
As a side note: this long term memory has a ‘strange’ side effect: once you have said that you have a bag, it can never be ‘unlearned’ again. You can say that you ‘don’t have a bag’. But you can not go back to the initial ‘unknown state’ (much like a child: I did not eat the cookies!  tongue laugh)

I was a bit confused by your screenshot. So are these templates designed to help the bot flag certain phrases that can be parsed with specific algorithms or…?

Note: I meant ‘synonym’ instead of ‘similar’
Yes, it requires a bit of knowledge on how frames work and what the ‘PathResult’ and ‘ValueResult’ things are.  Perhaps a word on these first: The purple things in the left top corner with labels like ‘PathResult’ refer to variables that should be present in the sentence structure. Below them, you can define some extra filters: which things should the variable contain or not.
Pathresult most often translates to the ‘Agent’, ‘ValueResult’ to the object part of a sentence. You also have ‘verb’ (obvious) and ‘Attribute’ which is usually deduced from the agent or object, but can also be in the form of a gerund for instance. here are some examples that I used to figure out how to translate things:

Sentence               Path   Attribute Value
I am your friend           I       friend   you
I am a brother’s friend   i     friend       a brother
Jan is my name           I       name   jan

So in the screenshot, I am saying that the word ‘synonym’, when found, needs an agent and a value result that needs to contain the preposition: of.
A second definition (not yet defined) would say: a path-result is required, but must contain multiple items (a and b are synonyms).
This information helps the bot figure out the likely-hood of a sentence combination + it also allows us to change some behaviour. In the case of ‘a and b are synonyms’, we can overwrite the default behaviour: flag a as a synonym and flag b as a synonym, but of what?, to link a and b with the meaning ‘synonym’.

So not the best example sentence then.

On the contrary, it’s these sort of things that keeps you sharp. A bot should be able to handle it, even if it is by asking a question to clarify things.

 

 
  [ # 8 ]

Interesting problem folks.  ‘I have a lunch bag’ versus ‘I have a hand’.  Hum, I think what I will do is convert ‘I have a lunch bag’ into ‘I currently possess a lunch bag’, Or ‘I am currently holding a lunch bag’. 

This will have to be based on information about what a lunch bag is, that is, what its purpose is, and knowledge that a ‘lunch bag’ is not one of the things that are attached to a human body.  ‘I have 5 fingers’.    The bot, say if it did not yet know that ‘I’ refers to a human and that humans have fingers, would not know at that point the real world meaning or semantics of the predicate ‘have 5 fingers’ until it would know more about fingers.    If it did not know that information, it would have to ask what sense of the verb ‘have’ is meant.  On the other hand (no pun intended), if it did already know that fingers are part of a hand and that hands are parts of a human body and the pronoun ‘I’ refers to human (unless it was talking to another bot), it could possibly deduce which sense of ‘have’ is being used—in this case, have meaning ‘physical part of’ and not ‘currently in possession of’.

So it seems that it is a catch-22, it has toalready know the information in order to know what it means when told.  Perhaps it only serves to UNDERSTAND – that is, map what you have told it to what it knows, rather than learn something new – at least in that instance.

One of the basic first things I will be doing with my bot GRACE is to say something like:

Me: Do you like France?
Grace :  I don’t know the word ‘France’
Me: France is a country in Europe
Grace: Ah! I see, well I’m not sure, what is it like there?

Since it will then understand that France is a place, it can ask what it is like there.

Assuming of course that previous to this it knows what ‘country’, ‘Europe’ refer to.

 

 
  [ # 9 ]

Such things can be deduced from a thesaurus relationship + conversation context + further ‘concrete’ information (assets) attached to ‘hand’ and ‘bag’ (the abstract object), so concrete knowledge about abstract objects like: a hand is normally attached to an arm which is attached to,....

 

 
  [ # 10 ]

Sounds like you have an effective approach for this.  In my project, it is something similiar… there will ALWAYS be that initial ambiguity, and as the bot applies more and more rules and associated knowledge, it can rule-out many generated possiblities, until it is left with 1, and if more than 1, produce a question to clarify.  Then, be able to understand the next input from the user (the answer) to that question, and adjust its initial assumption… BIG JOB we all have ahead of us!!

 

 
  [ # 11 ]
Jan Bogaerts - Dec 8, 2010:

@Robert: Perhaps you should take a look at my site. If you are looking for a library to handle be and have- relationships, a license is always negotiable.

I had a look at your site, and posted a reply to the Creator dialog showing how my bot handles it…

As for licensing, all the software I use in my bot is free smile

 

 
  [ # 12 ]

hey folks, I’ve been away for a day and this thread has grown significantly.

There are two things which come into my mind reading this and they both go ‘back to basics’.

1. Ever heard of general game play? Computers have learned to win chess from humans in the nineties. Now, academics are working on allowing computers to learn rules for new games they’ve played before, and be good in it. Very interesting. We’re using insights from the past and we’re starting to generalize.

2. Ever heard of common sence computing? This has the same pre-assumptions. When you say ‘I’m going to the doctor’, all people know that a docter is a human being, he has an medical expertise and you normally go to the docter when you’re ill. Ill is a bad medical condition, and human tend to avoid that condition. As conversational partners often have a emotional engagement, they want to prevent that others who they care about suffer from a Ill condition and they might be able to avoid that situation. Therefore, they need more information. So the next logical question is: ‘what’s wrong?’.  All the rules states before is regarded as ‘common sense knowledge’.

 

 
  [ # 13 ]

About general game play:
-Does this mean that you believe the rules to learn new rules, should also be self learned (as was tried with initial neural networks), or is there some kind of ‘initial’ state required?
-Do game rules map to language rules, are the neural structures for a game the same as for language?

about the doctor: What if I have a friend who is a doctor in philosophy and likes to call himself ‘doctor’, upon which we gave him the nickname ‘the doctor’?
Clues, other then text are often far more important in our conversations. Think of intonation, physical appearance, body posture,.... These are all things we use to asses a situation (although often subconsciously), which we currently can’t use in a chatbot.

 

 
  [ # 14 ]
Jan Bogaerts - Dec 9, 2010:

About general game play:
-Does this mean that you believe the rules to learn new rules, should also be self learned (as was tried with initial neural networks), or is there some kind of ‘initial’ state required?

I’d like to know this too. What is presumed? What is learned? What is the syntax through which learning takes place? Language based or through example in a game-like environment?

Jan Bogaerts - Dec 9, 2010:

Clues, other then text are often far more important in our conversations. Think of intonation, physical appearance, body posture,.... These are all things we use to asses a situation (although often subconsciously), which we currently can’t use in a chatbot.

Fortunately, we have a long written history which has developed standards for how to interact through written words alone. The limitations of the written medium have led to the development of phrasing conventions that help mitigate the problem of losing other sensory input. We can reasonably expect people to interact with a text-based bot the same way they would interact with a person via letter, email, or chat.

As an aside, this has got me thinking about the advantages of building a bot not designed to “chat”, but instead designed to answer letters. It would certainly allow the bot to further research terms it does not understand before formulating a reply (the immediacy factor of chatting is removed). Perhaps the bot could have some rubric it uses to gauge its understanding of a letter before replying. I guess in the end this is not much different from my initial design goal: to have a bot that can read text and summarize it. The next stage—formulating a return letter—would lead naturally towards a “chat” format.

Of course, the obvious disadvantage is that the letter writing bot would not be able to minutely query the letter writer about parts it does not understand. It wouldn’t be much of a reply letter if it was one line long, would it?

Okay, enough rambling.

 

 
  [ # 15 ]
Jan Bogaerts - Dec 9, 2010:

about the doctor: What if I have a friend who is a doctor in philosophy and likes to call himself ‘doctor’, upon which we gave him the nickname ‘the doctor’?
Clues, other then text are often far more important in our conversations. Think of intonation, physical appearance, body posture,.... These are all things we use to asses a situation (although often subconsciously), which we currently can’t use in a chatbot.

You could take this so far as to say every word I am using in this sentence really means something else.  Example, I have friend whose name is “You could”  , that is his first name is You, and last name is ‘could’... etc and 1/2 the other words mean something else.

Erwin’s point about ‘common sense computing’ is just that… in NORMAL situations when most people say ‘doctor’ they mean a person which is a medical practitioner.  Now, CONTEXT comes into play.  If, in a previous sentence, or even in a statement made earlier in the current conversation you said something like “I met Bob - he calls himself ‘the doctor’”.  THEN, ok, your context takes precedence and know that ‘the doctor’ here means Bob.  Even the specific person you are talking to, the next time the bot talks to someone else and sees ‘the doctor’, unless it has some context sensitive interpretation of ‘the doctor’ , it should initially assume the most common interpretation, (medical practitioner).  If the bot is talking to a more educated individual, it would not assume medical and instead ask ‘Really, what is he or she a doctor of???’

So I think the point of common sense reasoning is, unless context indicates otherwise, as a default, choose the most common interpretation (‘the doctor’ (to most people) == medical practitioner).

Humans don’t endlessly search for uncommon ‘what-ifs’…  “I bought a car”…hum, maybe they don’t mean car, maybe that means something else, “I bought a coffee” .. hum, maybe ‘coffee’ means something else… no… you assume a car is a car, a coffee is a coffee.  If you are wrong, you are told and reply “I see”.    The point being you wouldn’t get anywhere, it would be “paralysis by analysis” – this is what I think had hindered so much of early AI work.  When children learn that a dog is a dog, the next time they hear something like “I am going to get you a dog” , they don’t ask to confirm if dog still has the same meaning… unless, in the future they learn something new, then they know they have to differentiate the meaning.

 

 

 1 2 > 
1 of 2
 
  login or register to react