 |
Story 6: I was born in Canada
Story: I was born in Canada. Question: What country was I born in? Answer: Canada
Required knowledge about the world
person has_a birth birth is_a event event has_a location 0.9: location has_a country "Canada" -> Canada: noun Canada is_a country country is_a location "born" -> birth: noun |
|
Parsing the statement
{noun} was {fragment} -> $1.(($2)) I was born in Canada -> speaker.((born in Canada))
{verb} in {location} -> $1.location = $2 speaker.((born in Canada)) -> speaker.birth.location = Canada |
|
Parsing the question
what {fragment}? -> $1 What country was I born in? -> country was I born in
{noun} was {noun} {verb} {participle} -> $2.(($3 $4 $1)) country was I born in -> speaker.((born in country))
{verb} in {location} -> $1.$2 speaker.((born in country)) -> speaker.birth.country |
|
Comments
Of interest is the following transformations:
{verb} in {location} -> $1.location = $2 {verb} in {location} -> $1.$2 |
|
The first is used to parse a statement, the second to answer a question. What makes the second transformation more interesting is that it takes an intermediate form as its input. In this example, the fragment "born in country" wasn't a part of the original question and isn't quite valid English.
Also of interest is that we set speaker.birth.country rather than speaker.birth.location.country. Under the covers, the engine needs to search the has_a graph to determine which child of birth has a country node. The successful search path is:
birth is_a event event has_a location location has_a country |
| |
|
 |