Yeah, I’d like to use PLOW to teach an agent to parse the TRIPS parser output automatically…(Note it gets “Fruit flies like a banana” wrong.)
But PLOW doesn’t seem to be available for download. TRIPS parser either.
So maybe I can start with the Stanford Lexparser,
> parse: John ate an apple.
(S
(NP (NNP John))
(VP (VBD ate)
(NP (DT an) (NN apple)))
(. .)))
> The subject is John.
[Agent searches for “John” in the parse tree and associates the tags next to it with “subject”]
> What is the subject of “John ate an apple”?
[Agent tells itself to “parse: John ate an apple”, then searches through the parse tree for the tags associated with “subject”, and hypothesizes that this is the answer to the question.]
> What is the subject of “The philosopher ate an apple”?
[Agent doesn’t find the same sequence of tags associated with “subject”, so it gets the answer wrong.]
> The subject of “The philosopher ate an apple” is “The philosopher”
[Agent now associates the DET-NN tags with “subject”.]
etc.
Actually it would probably be easier to use stanford’s dependency relations to extract subject-verb-object:
> dependencies: John ate an apple.
nsubj(ate-3, John-2)
root(ROOT-0, ate-3)
det(apple-5, an-4)
dobj(ate-3, apple-5)
Now the agent could associate “subject” in a query with “nsubj”.
If first taught “The verb in ‘John ate an apple’ is ‘ate’”, the agent could associate “what is the verb” with the “root” tag.
I don’t know how to correct the following misparse, though:
> dependencies: Fruit flies like a banana.
nsubj(flies-3, Fruit-2)
root(ROOT-0, flies-3)
det(banana-6, a-5)
prep_like(flies-3, banana-6)
Actually, I have an idea but it would involve totally rewriting the parser’s output. I actually tried something like this with Link grammar, and it was so complicated I don’t think I could make it work now. So I try to find a way that’s easier to remember months (or years) later…