Package edu.umd.hooka

Examples of edu.umd.hooka.Alignment.align()


    Alignment res = new Alignment(fs.length, es.length);
    AlignmentPosteriorGrid g = computeAlignmentPosteriors(sentence);
    for (int j=0; j<fs.length; j++) {
      for (int i=1; i<es.length; i++) {
        float post = g.getAlignmentPointPosterior(j, i);
        if (post > threshold) { res.align(j, i-1); }
      }
    }
    return res;
  }
View Full Code Here


        if (curProb > bestProb) { bestProb = curProb; besti = i; }
      }
      if (besti < 0) {
        ; //throw new RuntimeException("Implement or ignore!");
      } else {
        res.align(j, besti);
      }
      viterbiScore += Math.log(bestProb);
    }
    viterbiPerp.addFactor(viterbiScore - (fs.length * Math.log(es.length + 1.0)), fs.length);
    return res;
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.