Package edu.stanford.nlp.util

Examples of edu.stanford.nlp.util.Beam


    for (int pos = 0; pos < padLength; pos++) {
      tags[pos] = ts.getPossibleValues(pos);
      tagNum[pos] = tags[pos].length;
    }

    Beam newBeam = new Beam(beamSize, ScoredComparator.ASCENDING_COMPARATOR);
    TagSeq initSeq = new TagSeq();
    newBeam.add(initSeq);
    for (int pos = 0; pos < padLength; pos++) {
      //System.out.println("scoring word " + pos + " / " + (leftWindow + length) + ", tagNum = " + tagNum[pos] + "...");
      //System.out.flush();

      Beam oldBeam = newBeam;
      if (pos < leftWindow + rightWindow && exhaustiveStart) {
        newBeam = new Beam(100000, ScoredComparator.ASCENDING_COMPARATOR);
      } else {
        newBeam = new Beam(beamSize, ScoredComparator.ASCENDING_COMPARATOR);
      }
      // each hypothesis gets extended and beamed
      for (Iterator beamI = oldBeam.iterator(); beamI.hasNext();) {
        // System.out.print("#"); System.out.flush();
        TagSeq tagSeq = (TagSeq) beamI.next();
        for (int nextTagNum = 0; nextTagNum < tagNum[pos]; nextTagNum++) {
          TagSeq nextSeq = tagSeq.tclone();
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.util.Beam

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.