I want to extract the subject, predicate, and object of a sentence and find out which adjectives go to the subject, predicate, or object with Stanford CoreNLP in java code.
I have tried to use the dependency parser to solve this by finding the dependency index, checking the dependency tag if it equals amod, then adding it to an ArrayList, but with this method sometimes the adjective's dependency tag is not amod and is nmod, and other tags may come up.
With determining the object and predicate, I have used a similar method as above. I have checked if it is det, and if it is any other tags that mean it is a predicate or object. However, sometimes different tags come up and it is not efficient to have to parse every tag that somewhat means it is a predicate pointing to the object.
So my question is, how to I get the subject, predicate, and object of a sentence and each's adjectives but not need to check each tag?
For the above mentioned attempts, I have used Stanford CoreNLP Simple API, but I am OK with the standard API if it is truly needed.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…