List of usage examples for edu.stanford.nlp.neural.rnn RNNCoreAnnotations getNodeVector
public static SimpleMatrix getNodeVector(Tree tree)
From source file:opennlp.tools.parse_thicket.opinion_processor.DefaultSentimentProcessor.java
License:Apache License
/** * Outputs the vectors from the tree. Counts the tree nodes the same as * setIndexLabels.//from w w w . j a v a2 s . com */ static int outputTreeVectors(PrintStream out, Tree tree, int index) { if (tree.isLeaf()) { return index; } out.print(" " + index + ":"); SimpleMatrix vector = RNNCoreAnnotations.getNodeVector(tree); for (int i = 0; i < vector.getNumElements(); ++i) { out.print(" " + NF.format(vector.get(i))); } out.println(); index++; for (Tree child : tree.children()) { index = outputTreeVectors(out, child, index); } return index; }