Reputation: 1396
Let´s suppose I want to build directed graphs with an algorithm that can read through a parragraph and build edges between nouns and their corresponding adjectives.
Example: Input String
"Owls are solitary and nocturnal birds of prey."
Output should look something like this:
Owls = {adjectives:"solitary, nocturnal, birds"}
If the above is not possible, what would be the best way to get some adjectives that describe a noun?
Upvotes: 1
Views: 181
Reputation: 1012
A more general approach for what you're asking is to use a Dependency Parser which extracts various types of relationship between words in a sentence.
The input of the parser is a sentence, and its output is a dependency tree over the words, where each edge denotes a dependency relation between two words.
Consider the following example (taken from the wiki entry linked above). In the sentence, "syntactic" is an adjective describing "functions". The parse tree encodes this information by connecting the two words with an edge labeled ATTR (attribute).
You can find dependency parsers for many languages online. A good starting point is python's NLTK package.
Upvotes: 1
Reputation: 39277
If you are looking for all adjectives that could describe a noun your best starting place might be the Google NGram dataset. You can try the viewer here which shows that 'horned', 'barn', 'screech' are all common adjectives for owls.
Alternatively, if you are trying to tag specific sentences to find adjectives related to a noun you should try one of the part of speech taggers.
Upvotes: 1