S******y 发帖数: 1123 | 1 I would like to distinguish two kinds of texts -
1) something like - 'a little dog hit a big fox in his face'
2) something like - 'a little dog got a hit from a big fox'
of course, in reality, they can be all sorts of variations such as
'brown dog received a hit from fox' or 'a cute dog was hit by a fox' or
'a brave dog delivered a direct hit to the fox ', etc...
Currently, my computer code can only tell something like -
'... dog ...hit ...fox...'
But - I could not tell whether the poor little dog -
1) is actively
2) is passively
related to 'hit'.
Can somebody give some suggestion on how to differentiate it ?
Does Perl or Python Regular Expression have a solution to this?
Thanks. | l*******s 发帖数: 1258 | 2 In my opition, this is a ambiguity problem in parsing.
There are more than one parsing for each sentence you mentioned, then the
dog could be either active or passive.
If you have more context, you might be able to figure out active or passive.
However, just according to the independent sentences, it is almost
impossible.
about parser, you can try Stanford parser:
http://nlp.stanford.edu:8080/parser/
an online demo.
ps: I don't think RE can help, because this is not a string match problem | S******y 发帖数: 1123 | 3 Thanks!
That was very helpful! |
|