title: Extracting relations from dependency tree
body: <p>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.</p>
  
  <p>Problem is the moment you go beyond a simple sentence like "I am happy", appositive phrases, <code>ccomp</code> and <code>xcomp</code> compound verbs and <code>conj</code> conjunctions, finding relations becomes more complicated.</p>
  
  <p>Example: "My teacher, Bob is a great teacher" (my teacher, is, great teacher) &amp; (My teacher, is, Bob)</p>
  
  <p>"My friends and I don't like running or jumping." (my friends, don't like, running) &amp; (my friends, don't like, jumping) &amp; (I, don't like, running) &amp; (I, don't like, jumping)</p>
  
  <p>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).</p>
  
  <p>My question is: <em>Are there any open source libraries for Java that could perform this relation extraction - either directly from the text or from a dependency parse?</em></p>
  
  <p>I did come accross: <a href="https://github.com/knowitall/ollie" rel="nofollow">https://github.com/knowitall/ollie</a> 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.</p>
  
  <hr>
  
  <p><strong>Another idea:</strong> 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?</p>