title: How to get phrase-level sentiment from Stanford Core NLP package
body: <p>This might not be a very relevant question to this community. But I thought it would let me reach out to the wider computer science community and get help.</p>
  
  <p>I am using the Stanford Core NLP package, more specifically the <a href="http://nlp.stanford.edu/sentiment/index.html" rel="nofollow noreferrer">Sentiment module</a> of it. I am getting sentence level sentiment by using the following command. </p>
  
  <pre><code>java -cp stanford-corenlp-3.4.jar:stanford-corenlp-3.4-models.jar:xom.jar:joda-time.jar:jollyday.jar:ejml-0.23.jar -mx2g edu.stanford.nlp.sentiment.SentimentPipeline -stdin &lt; input.txt
  </code></pre>
  
  <p>But I need the phrase-level sentiment, like we see in the <a href="http://nlp.stanford.edu:8080/sentiment/rntnDemo.html" rel="nofollow noreferrer">online demo</a>. I am not being able to figure out how.</p>
  
  <p>EDIT: </p>
  
  <p>After looking into the source code, I figured that just by adding another argument to the above-mentioned command, it is possible to get sentiment score for each node of the parse tree representation of a sentence. However, this gives only a numeric sentiment score as opposed to a positive/negative sentiment. But I think it is fairly trivial to translate this score to a binary positive/negative sentiment. The command is:</p>
  
  <pre><code>java -cp stanford-corenlp-3.4.jar:stanford-corenlp-3.4-models.jar:xom.jar:joda-time.jar:jollyday.jar:ejml-0.23.jar -mx2g edu.stanford.nlp.sentiment.SentimentPipeline -stdin -output PENNTREES &lt; input.txt
  </code></pre>