Package org.apache.log4j

Examples of org.apache.log4j.Logger.debug()


         {
      String text = Files.readFromFile( new File(classDir, testingFiles[j]) );
      logger.debug("Testing on " + CATEGORIES[i] + File.separator + testingFiles[j]);
      JointClassification jc =  compiledClassifier.classifyJoint(text);
          confMatrix.increment(CATEGORIES[i], jc.bestCategory());
          logger.debug("Best Category: " + jc.bestCategory() );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
          for (int k = 0; k < CATEGORIES.length; k++) sb.append(nf.format(jc.score(k)) + " ");
          logger.debug(sb);
     } //*-- end of inner for
View Full Code Here


          confMatrix.increment(CATEGORIES[i], jc.bestCategory());
          logger.debug("Best Category: " + jc.bestCategory() );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
          for (int k = 0; k < CATEGORIES.length; k++) sb.append(nf.format(jc.score(k)) + " ");
          logger.debug(sb);
     } //*-- end of inner for
    } //*-- end of outer for
     
      logger.info("--------------------------------------------");
      logger.info("- Results ");
View Full Code Here

     */ 
    public static void main(String[] args) throws ClassNotFoundException, IOException
    {
      PropertyConfigurator.configure (Constants.LOG4J_FILE);
      Logger logger = Logger.getLogger(TestFtypeClassifier.class.getName());
      logger.debug("Started TestFtypeClassifier");

      //*-- read the classification model
      String modelFile = Constants.FTYPE_CLASS_MODEL;
      ObjectInputStream oi = new ObjectInputStream( new FileInputStream(modelFile) );
      LMClassifier compiledClassifier = (LMClassifier) oi.readObject();
View Full Code Here

         {
      String text = Files.readFromFile( new File(classDir, testingFiles[j]) );
     
      //*-- limit the length of the text
        if (text.length() > 500text = text.substring(0, 500);
      logger.debug("Testing on " + CATEGORIES[i] + File.separator + testingFiles[j]);
      JointClassification jc =  compiledClassifier.classifyJoint(text);
     
      //*-- check if we have sufficient confidence in the decision
      String bestCategory = (jc.score(0) > -2.5) ? jc.bestCategory(): "text";
      confMatrix.increment(CATEGORIES[i], bestCategory)
View Full Code Here

      JointClassification jc =  compiledClassifier.classifyJoint(text);
     
      //*-- check if we have sufficient confidence in the decision
      String bestCategory = (jc.score(0) > -2.5) ? jc.bestCategory(): "text";
      confMatrix.increment(CATEGORIES[i], bestCategory)
          logger.debug("Best Category: " + bestCategory );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
          for (int k = 0; k < CATEGORIES.length; k++)
            sb.append(nf.format(jc.score(k)) + " ");
          logger.debug(sb);
View Full Code Here

          logger.debug("Best Category: " + bestCategory );
          StringBuffer sb = new StringBuffer();
          sb.append("Scores ");
          for (int k = 0; k < CATEGORIES.length; k++)
            sb.append(nf.format(jc.score(k)) + " ");
          logger.debug(sb);
     } //*-- end of inner for
    } //*-- end of outer for
     
      logger.info("--------------------------------------------");
      logger.info("- Results ");
View Full Code Here

public static void main(String[] args) throws ClassNotFoundException, IOException
{
  PropertyConfigurator.configure (Constants.LOG4J_FILE);
  Logger logger = Logger.getLogger(TrainMClassifier.class.getName());
  logger.debug("Started TrainMClassifier");
  DynamicLMClassifier classifier = new DynamicLMClassifier(CATEGORIES, NGRAM_SIZE, BOUNDED);

  //*-- Start of training
  //*-- loop through the list of categories and verify that a directory exists for each one.
  for (int i = 0; i < CATEGORIES.length; ++i)
View Full Code Here

   //*-- get the list of training files for the category and train the classifier on each of the files
   String[] trainingFiles = classDir.list();
   for (int j=0; j<trainingFiles.length; ++j)
   {
    String text = Files.readFromFile(new File(classDir,trainingFiles[j]));
    logger.debug("Training on " + CATEGORIES[i] + File.separator + trainingFiles[j]);
    classifier.train(CATEGORIES[i], text);
   } //*-- end of inner for
  } //*-- end of outer for
  //*-- end of training

View Full Code Here

  String modelFile = MUSTRU_HOME + File.separator + "data" + File.separator + "training" + File.separator + "tcat" + File.separator + "tcat_classifier";
  ObjectOutputStream os = new ObjectOutputStream( new FileOutputStream(modelFile) );
  classifier.compileTo(os);
  os.close();
  logger.info("End compiling classifier");
  logger.debug("Ended TrainMClassifier");
}
}
View Full Code Here

  */
public static void main(String[] args) throws IOException
{
  PropertyConfigurator.configure (Constants.LOG4J_FILE);
  Logger logger = Logger.getLogger(TrainPOSTagger.class.getName());
  logger.debug("Started POS tagged model generation");

  //*-- set up parser with estimator as handler
  HmmCharLmEstimator estimator = new HmmCharLmEstimator(N_GRAM, NUM_CHARS, LAMBDA_FACTOR);
  Parser parser = new BrownPosParser();
  parser.setHandler(estimator);
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.