Package joshua.discriminative.bleu_approximater

Examples of joshua.discriminative.bleu_approximater.NbestReader


public class NbestMerger {
 
  public static int mergeNbest(String nbestFile1, String nbestFile2, String nbestOutFile){
    int totalNumHyp = 0;
    try {
      NbestReader nbestReader1 = new NbestReader(nbestFile1);
      NbestReader nbestReader2 = new NbestReader(nbestFile2);
      BufferedWriter outWriter = FileUtility.getWriteFileStream(nbestOutFile);
     
      while(nbestReader1.hasNext()){
        List<String> nbest1 = nbestReader1.next();
        List<String> nbest2 = nbestReader2.next();
    
        List<String> newNbest = processOneSentence(nbest1, nbest2);
        for(String hyp : newNbest){
          outWriter.write(hyp+"\n");
        }
View Full Code Here

TOP

Related Classes of joshua.discriminative.bleu_approximater.NbestReader

Copyright © 2018 www.massapicom. 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.