简体   繁体   English

Stanford Dependency Parser-如何获取短语向量?

[英]Stanford Dependency Parser - How to get phrase vectors?

In the DependencyParser.java repository , I can see it's using recursive neural networks. DependencyParser.java存储库中 ,我可以看到它正在使用递归神经网络。 And from the open lecture ( http://cs224d.stanford.edu ), I learned that these networks calculate phrase vectors at each node of the parse tree. 从公开演讲( http://cs224d.stanford.edu )中,我了解到这些网络在解析树的每个节点上计算短语向量。

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~) (我怀疑他们会在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. 而且,如果这不是查找短语向量的正确位置,那么如果您能指出我应该关注的CoreNLP项目中的代码,我将不胜感激。

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 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. 它为单词,词性标签和相关性标签创建嵌入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM