In the DependencyParser.java repository, I can see it’s using recursive neural networks. And from the open lecture (http://cs224d.stanford.edu), I learned that these networks calculate phrase vectors at each node of the parse tree.
I'm trying to make the Parser to output phrase vectors so that I can plot them on the 2-d plane but so far I haven't figured it out. - Can someone please point me to the java object and line numbers where they are calculated? (I suspect that they would be in line 765~)
private void setupClassifierForTraining(List<CoreMap> trainSents, List<DependencyTree> trainTrees, String embedFile, String preModel) {
double[][] E = new double[knownWords.size() + knownPos.size() + knownLabels.size()][config.embeddingSize];
double[][] W1 = new double[config.hiddenSize][config.embeddingSize * config.numTokens];
double[] b1 = new double[config.hiddenSize];
double[][] W2 = new double[system.numTransitions()][config.hiddenSize];
And if this is not the correct place to be looking for phrase vectors, I'd really appreciate it if you could point me to the code in the CoreNLP project I should be looking at.
Which lecture are you referring to?
This paper describes the neural network dependency parser we distribute:
http://cs.stanford.edu/people/danqi/papers/emnlp2014.pdf
I don't believe it creates phrase embeddings ; it creates embeddings for words, part-of-speech tags, and for dependency labels.