Examples of numStates()


Examples of cc.mallet.fst.CRF.numStates()

    Pattern forbiddenPat = Pattern.compile(forbidden);
    Pattern allowedPat = Pattern.compile(allowed);
    CRF crf = new CRF(training.getPipe(), (Pipe)null);
    String startName = crf.addOrderNStates(training, orders, null,
        defaultLabel, forbiddenPat, allowedPat, connected);
    for (int i = 0; i < crf.numStates(); i++)
      crf.getState(i).setInitialWeight (Transducer.IMPOSSIBLE_WEIGHT);
    crf.getState(startName).setInitialWeight(0.0);
    crf.setWeightsDimensionDensely();
    return crf;
  }
View Full Code Here

Examples of cc.mallet.fst.CRF.numStates()

    Instance inst = instances.get(0);
    Sequence input = (Sequence) inst.getData();
    SumLatticeDefault lattice = new SumLatticeDefault(crf1, input,
        (Sequence) inst.getTarget(), null, true);
    for (int ip = 0; ip < lattice.length() - 1; ip++) {
      for (int i = 0; i < crf1.numStates(); i++) {
        Transducer.State state = crf1.getState(i);
        Transducer.TransitionIterator it = state.transitionIterator(
            input, ip);
        double gamma = lattice.getGammaProbability(ip, state);
        double xiSum = 0;
View Full Code Here

Examples of cc.mallet.fst.Transducer.numStates()

  private static void outputLatticeRows (PrintWriter out, MaxLattice lattice, int start, int end)
  {
    DecimalFormat f = new DecimalFormat ("0.##");
    Transducer ducer = lattice.getTransducer ();
    int max = Math.min (numMaxViterbi, ducer.numStates());
    List<Sequence<Transducer.State>> stateSequences = lattice.bestStateSequences(max);
    for (int k = 0; k < max; k++) {
      out.println ("  <tr class=\"delta\">");
      out.println ("    <td class=\"label\">&delta; rank "+k+"</td>");
      for (int ip = start; ip < end; ip++) {
View Full Code Here

Examples of cc.mallet.fst.Transducer.numStates()

  private static void outputLatticeRows (PrintWriter out, SumLatticeDefault lattice, int start, int end)
  {
    DecimalFormat f = new DecimalFormat ("0.##");
    Transducer ducer = lattice.getTransducer ();
    for (int k = 0; k < ducer.numStates(); k++) {
      Transducer.State state = ducer.getState (k);
      out.println ("  <tr class=\"alpha\">");
      out.println ("    <td class=\"label\">&alpha;("+state.getName()+")</td>");
      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getAlpha (ip+1, state))+"</td>");
View Full Code Here

Examples of cc.mallet.fst.Transducer.numStates()

      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getAlpha (ip+1, state))+"</td>");
      }
      out.println ("</tr>");
    }
    for (int k = 0; k < ducer.numStates(); k++) {
      Transducer.State state = ducer.getState (k);
      out.println ("  <tr class=\"beta\">");
      out.println ("    <td class=\"label\">&beta;("+state.getName()+")</td>");
      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getBeta (ip+1, state))+"</td>");
View Full Code Here

Examples of cc.mallet.fst.Transducer.numStates()

      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getBeta (ip+1, state))+"</td>");
      }
      out.println ("</tr>");
    }
    for (int k = 0; k < ducer.numStates(); k++) {
      Transducer.State state = ducer.getState (k);
      out.println ("  <tr class=\"gamma\">");
      out.println ("    <td class=\"label\">&gamma;("+state.getName()+")</td>");
      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getGammaWeight(ip+1, state))+"</td>");
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.