I'm looking for some help on strategy to be used for finding out if word is spoken in relation to another word.

For ex: The pool is dirty. Here dirty is spoken w.r.t pool

However, The pool was great but bathroom was dirty. Here dirty is spoken w.r.t bathroom and not pool.

What linguistic strategies can be used to enable this.

1 Answer 1


It sounds like you're asking for a way to link a subject to a predicate. (Informally, an adjective is a "predicate" when it "acts like a verb": red in the red book isn't a predicate, but in the book is red it is.)

The standard way to find relationships like this is "dependency parsing", which basically means "figuring out the syntactic relationships between words". In this case, I think the Stanford CoreNLP dependency parser will do what you want.

Here's a visualization of what the Stanford parser can tell you, which will probably help more than a paragraph of text (made here):

enter image description here

(This is just a visualization: the parser actually returns everything as a flat data structure, which your program can then use as it likes.)

If you go with this parser, you'll want to look for words with the JJ tag (adjectives), with an nsubj (noun subject) relationship to an NN (noun). If you're also interested in attributive adjectives, look for a NN with an amod (adjective modifier) relationship to a JJ.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.