Package joshua.discriminative.semiring_parsingv2

Examples of joshua.discriminative.semiring_parsingv2.DefaultInsideSemiringParser.insideEstimationOverHG()


    dhg_test.initRead(f_dev_items, f_dev_rules,null);
    for(int sent_id=0; sent_id < num_sents; sent_id ++){
      System.out.println("#Process sentence " + sent_id);
      HyperGraph hg_test = dhg_test.readHyperGraph();   
      ds.setHyperGraph(hg_test);
      ds.insideEstimationOverHG();
      ExpectationSemiring<LogSemiring,ScalarPM> goalSemiring = (ExpectationSemiring<LogSemiring,ScalarPM>) ds.getGoalK();
      //goal_semiring.printInfor();
      goalSemiring.getR().getValue().multiLogNumber(-goalSemiring.getP().getLogValue());//normalize
      goalSemiring.printInfor();
      double entropy = goalSemiring.getP().getLogValue() - goalSemiring.getR().getValue().convertToRealValue();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.