Examples of HyperGraph


Examples of joshua.decoder.hypergraph.HyperGraph

    System.out.println("############Process file  " + testItemsFile);
    DiskHyperGraph diskHG = new DiskHyperGraph(symbolTbl, ngramStateID, true, null); //have model costs stored
    diskHG.initRead(testItemsFile, testRulesFile,null);     
    for(int sentID=0; sentID < numSents; sentID ++){
      System.out.println("#Process sentence " + sentID);
      HyperGraph testHG = diskHG.readHyperGraph();
     
      List<String> nbest = cruncher.processOneSent(testHG, sentID, true);//produce the disorder nbest
     
      String bestHyp = mbrReranker.processOneSent(nbest, sentID);//nbest: list of unique strings
     
View Full Code Here

Examples of joshua.decoder.hypergraph.HyperGraph

    System.out.println("############Process file  " + testItemsFile);
    DiskHyperGraph diskHG = new DiskHyperGraph(symbolTbl, ngramStateID, true, null); //have model costs stored
    diskHG.initRead(testItemsFile, testRulesFile,null);     
    for(int sentID=0; sentID < numSents; sentID ++){
      System.out.println("#Process sentence " + sentID);
      HyperGraph testHG = diskHG.readHyperGraph();     
      List<String> oneBest = cruncher.processOneSent(testHG, sentID, false);//produce the reranked onebest
      FileUtilityOld.writeLzf(onebestWriter, oneBest.get(0) + "\n");
    }
    FileUtilityOld.closeWriteFile(onebestWriter);       
  }
View Full Code Here

Examples of joshua.decoder.hypergraph.HyperGraph

    DiskHyperGraph dhg_test = new DiskHyperGraph(p_symbol, baseline_lm_feat_id, true, null); //have model costs stored
    dhg_test.initRead(f_test_items, f_test_rules,null);   
    double sumGap = 0;
    for(int sent_id=0; sent_id < num_sents; sent_id ++){
      System.out.println("#Process sentence " + sent_id);
      HyperGraph hg_test = dhg_test.readHyperGraph();     
      double gap = cruncher.processOneSent(hg_test, sent_id, false);//produce the reranked onebest
      sumGap += gap;
    }
    sumGap *= 1.44;
    System.out.println("sum of bits in gap is: " +  sumGap);
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.