I am trying to extract relations (triples) from sentences and have been trying to manually sift through the dependency parse from Stanford's CoreNLP and pull out subject - verb - object relations that way.
Problem is the moment you go beyond a simple sentence like "I am happy", appositive phrases, ccomp
and xcomp
compound verbs and conj
conjunctions, finding relations becomes more complicated.
Example: "My teacher, Bob is a great teacher" (my teacher, is, great teacher) & (My teacher, is, Bob)
"My friends and I don't like running or jumping." (my friends, don't like, running) & (my friends, don't like, jumping) & (I, don't like, running) & (I, don't like, jumping)
Stanford's OpenIE really doesn't work well for these scenarios (it resolves the first example fairly well, but doesn't get any relations for the second).
My question is: Are there any open source libraries for Java that could perform this relation extraction - either directly from the text or from a dependency parse?
I did come accross: https://github.com/knowitall/ollie which looks very promising - however Ollie is strictly prohibited for commercial use and I need to be able to use the library for commercial use in the future.
Another idea: I'm not very familiar with machine learning techniques - but I was thinking, could I somehow pass a dependency parse of a sentence to some ML model training algorithm with my desired outputs as shown in the examples above and train a model that could do this relation extraction for me?