Find the subject of a sentence given the verb and noun: POS_ tagging (avoiding noun-chunks!) #9490
-
Example: I have a report, and from that report I want to pick out all of the names that have paid certain fines. Furthermore, I would need to consider the fact that many sentences may be phrased differently: 'Michael paid a £10,000 fine.' I would like to find the best way to find the subject of the sentence (PERSON entity) given the MONEY entity and VERB of the sentence Task:
If there was a way a to be able to specify what part of the sentence I want to find given the verb, I would be able to instantly select the 'nsubj'. Ideally, the task would be:
In an ideal world, there would be a query I could write to say: 'for each sentence, if MONEY entity and PERSON entity share VERB (or if both entities are 'connected' as subject and object, add entities to dataframe'... Hope this makes sense! Thank you 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If at all possible, I would like to do the following:
Further conditions might be that the verb is similarly to 'paid' (and other versions/ lemmatisation) I would also have to consider passive phrases like: 'A fine of £100 was paid by Philip.' |
Beta Was this translation helpful? Give feedback.
-
Uh, have you seen the DependencyMatcher? It sounds like what you want is a rather straightforward application of it. If you want to work with entities as single tokens you can use the |
Beta Was this translation helpful? Give feedback.
Uh, have you seen the DependencyMatcher? It sounds like what you want is a rather straightforward application of it.
If you want to work with entities as single tokens you can use the
merge_entities
pipe.