 |
Story 5: I am 27. What year was I born in?
Story: I am 27. Question: What year was I born in? Answer: 1980 or 1981 (assuming the current year is 2008)
We've already parsed the statement. The new challenge is answering the question, which requires us to derive speaker.birth.date.year from speaker.age. What makes this even more complicated is that the answer could be one of two years, depending on what month and day the person was born in.
Required knowledge about the world
person has_a birth birth is_a event event has_a date date has_a year date has_a month date has_a day "I" -> speaker "born" -> birth: noun |
|
Transformation 1
The word "what" doesn't do a whole lot other than make it clear to the reader that a question is being asked. We can drop it. We introduce the term {fragment} to mean "list of words".
Application:
| What year was I born in? -> year was I born in? |
|
Transformation 2
| {noun} was {noun} {verb} {participle} -> $2.(($3 $4 $1)) |
|
Application:
| year was I born in -> speaker.((born in year)) |
|
Here we introduce another intermediate form that is partly represented in English. The two round brackets indicate that the English fragment inside has yet to be evaluated, but represents a property of speaker.
Transformation 3
| {verb} in {year} -> $1.date.$2 |
|
Application:
| speaker.((born in year)) -> speaker.birth.date.year |
|
Of interest here is the mapping of the word "born", which is a verb, to the noun birth.
Rules
Although we can transform the question to speaker.birth.date.year, we don't know its value. We only know speaker.age, so we'll need to use rules to derive speaker.birth.date.year.
0.5: rule: $x.age = $y -> $x.birth.date.year = current_date.year - $x.age |
|
0.5: rule: $x.age = $y -> $x.birth.date.year = current_date.year - $x.age - 1 |
|
Aside from introducing some math into our rules, what is interesting here is that determining a person's birth year given their age isn't as simple as subtracting their age from the current year.
To accommodate this, we also introduce a sort of weight with each rule, which says that there is roughly a 50% chance that the rule can be applied. Thus, when the AI tries to derive speaker.birth.date.year, it will find both rules, and because it will be ambiguous which rule to apply, it must report both answers as possibilities. |
|
 |