@@ -0,0 +1,1382 @@
+package chart_parser;%0A%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0A%0Aimport cat_combination.RuleInstancesParams;%0Aimport cat_combination.SuperCategory;%0Aimport model.Lexicon;%0Aimport uk.ac.cam.cl.depnn.DependencyNeuralNetwork;%0A%0Apublic class ChartParserBeamNN extends ChartParserBeam %7B%0A%09private DependencyNeuralNetwork nn;%0A%0A%09public ChartParserBeamNN(String grammarDir,%0A%09%09%09boolean altMarkedup,%0A%09%09%09boolean eisnerNormalForm,%0A%09%09%09int MAX_WORDS,%0A%09%09%09int MAX_SUPERCATS,%0A%09%09%09RuleInstancesParams ruleInstancesParams,%0A%09%09%09Lexicon lexicon,%0A%09%09%09String modelDir,%0A%09%09%09boolean cubePruning,%0A%09%09%09int beamSize,%0A%09%09%09double beta) throws IOException %7B%0A%09%09super(grammarDir, altMarkedup, eisnerNormalForm, MAX_WORDS, MAX_SUPERCATS, ruleInstancesParams, lexicon, null, null, false, false, cubePruning, beamSize, beta);%0A%0A%09%09nn = new DependencyNeuralNetwork(modelDir);%0A%09%7D%0A%0A%09@Override%0A%09public void calcScore(SuperCategory superCat, boolean atRoot) %7B%0A%09%09SuperCategory leftChild = superCat.leftChild;%0A%09%09SuperCategory rightChild = superCat.rightChild;%0A%0A%09%09ArrayList%3CArrayList%3CString%3E%3E features = getFeature(sentence, superCat);%0A%0A%09%09for ( ArrayList%3CString%3E feature : features ) %7B%0A%09%09%09// double score = nn.predict(feature)%0A%09%09%09// superCat.score += score;%0A%09%09%7D%0A%0A%09%09if (leftChild != null) %7B%0A%09%09%09if (rightChild != null) %7B%0A%09%09%09%09superCat.score += rightChild.score;%0A%09%09%09%7D else %7B%0A%09%09%09%09superCat.score += leftChild.score;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add ChartParserBeamNN