Main topic and object extraction using MeTA



I am a C++ developer, I have some very basic knowledge of NLP and I would like to know how can I extract the main topic and the object of a sentence using MeTA.

"People need to allow themselves lots of extra time for reaching the rally point."
People would be the main topic,
Additionally I would like to spot: “the rally point”, which is the object of the sentence.

Many thanks for any help!


So there’s not functionality for this exactly in MeTA, but the current tools should be able to give you output from which you can extract these sorts of things.

The first step would be to parse your sentence using something like the sr_parser object. This will give you a constituency parse tree denoting the (inferred) phrase structure of the sentence. Then, you can look at the nodes of the tree that is returned to identify the subject and predicate and extract the noun/noun phrase from both.

An alternative method, which MeTA doesn’t yet implement, would be to use a dependency parse, which gives more direct access to this sort of thing. I would recommend SpaCy or Stanford Dependencies for a good implementation of a dependency parser.

You could also extract dependency parses from constituency parses using a method like described in this paper.