Examples of averageTokenAccuracy()


Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

    } else {
      System.out.println("Training Accuracy before training = " + memm.averageTokenAccuracy(lists[0]));
      System.out.println("Testing  Accuracy before training = " + memm.averageTokenAccuracy(lists[1]));
      System.out.println("Training...");
      memmt.train(lists[0], 1);
      System.out.println("Training Accuracy after training = " + memm.averageTokenAccuracy(lists[0]));
      System.out.println("Testing  Accuracy after training = " + memm.averageTokenAccuracy(lists[1]));
      System.out.println("Training results:");
      for (int i = 0; i < lists[0].size(); i++) {
        Instance inst = lists[0].get(i);
        Sequence input = (Sequence) inst.getData ();
View Full Code Here

Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

      System.out.println("Training Accuracy before training = " + memm.averageTokenAccuracy(lists[0]));
      System.out.println("Testing  Accuracy before training = " + memm.averageTokenAccuracy(lists[1]));
      System.out.println("Training...");
      memmt.train(lists[0], 1);
      System.out.println("Training Accuracy after training = " + memm.averageTokenAccuracy(lists[0]));
      System.out.println("Testing  Accuracy after training = " + memm.averageTokenAccuracy(lists[1]));
      System.out.println("Training results:");
      for (int i = 0; i < lists[0].size(); i++) {
        Instance inst = lists[0].get(i);
        Sequence input = (Sequence) inst.getData ();
        Sequence output = memm.transduce (input);
View Full Code Here

Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

    // memmt.setUseSparseWeights (useSparseWeights);
    if (testValueAndGradient) {
      Optimizable.ByGradientValue minable = memmt.getOptimizableMEMM(lists[0]);
      TestOptimizable.testValueAndGradient(minable);
    } else {
      System.out.println("Training Accuracy before training = " + crf.averageTokenAccuracy(lists[0]));
      System.out.println("Testing  Accuracy before training = " + crf.averageTokenAccuracy(lists[1]));
      savedCRF = crf;
      System.out.println("Training serialized crf.");
      memmt.train(lists[0], 100);
      double preTrainAcc = crf.averageTokenAccuracy(lists[0]);
View Full Code Here

Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

    if (testValueAndGradient) {
      Optimizable.ByGradientValue minable = memmt.getOptimizableMEMM(lists[0]);
      TestOptimizable.testValueAndGradient(minable);
    } else {
      System.out.println("Training Accuracy before training = " + crf.averageTokenAccuracy(lists[0]));
      System.out.println("Testing  Accuracy before training = " + crf.averageTokenAccuracy(lists[1]));
      savedCRF = crf;
      System.out.println("Training serialized crf.");
      memmt.train(lists[0], 100);
      double preTrainAcc = crf.averageTokenAccuracy(lists[0]);
      double preTestAcc = crf.averageTokenAccuracy(lists[1]);
View Full Code Here

Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

      System.out.println("Training Accuracy before training = " + crf.averageTokenAccuracy(lists[0]));
      System.out.println("Testing  Accuracy before training = " + crf.averageTokenAccuracy(lists[1]));
      savedCRF = crf;
      System.out.println("Training serialized crf.");
      memmt.train(lists[0], 100);
      double preTrainAcc = crf.averageTokenAccuracy(lists[0]);
      double preTestAcc = crf.averageTokenAccuracy(lists[1]);
      System.out.println("Training Accuracy after training = " + preTrainAcc);
      System.out.println("Testing  Accuracy after training = " + preTestAcc);
      try {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f));
View Full Code Here

Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

      System.out.println("Testing  Accuracy before training = " + crf.averageTokenAccuracy(lists[1]));
      savedCRF = crf;
      System.out.println("Training serialized crf.");
      memmt.train(lists[0], 100);
      double preTrainAcc = crf.averageTokenAccuracy(lists[0]);
      double preTestAcc = crf.averageTokenAccuracy(lists[1]);
      System.out.println("Training Accuracy after training = " + preTrainAcc);
      System.out.println("Testing  Accuracy after training = " + preTestAcc);
      try {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f));
        oos.writeObject(crf);
View Full Code Here

Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

          System.err.println("Cound not find class reading in object: " + cnfe);
        }
        System.err.println("Read in CRF.");
        crf = savedCRF;

        double postTrainAcc = crf.averageTokenAccuracy(lists[0]);
        double postTestAcc = crf.averageTokenAccuracy(lists[1]);
        System.out.println("Training Accuracy after saving = " + postTrainAcc);
        System.out.println("Testing  Accuracy after saving = " + postTestAcc);

        assertEquals(postTrainAcc, preTrainAcc, 0.0001);
View Full Code Here

Examples of cc.mallet.fst.MEMM.averageTokenAccuracy()

        }
        System.err.println("Read in CRF.");
        crf = savedCRF;

        double postTrainAcc = crf.averageTokenAccuracy(lists[0]);
        double postTestAcc = crf.averageTokenAccuracy(lists[1]);
        System.out.println("Training Accuracy after saving = " + postTrainAcc);
        System.out.println("Testing  Accuracy after saving = " + postTestAcc);

        assertEquals(postTrainAcc, preTrainAcc, 0.0001);
        assertEquals(postTestAcc, preTestAcc, 0.0001);
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.