edu.stanford.nlp.tagger.maxent
Class TestClassifier

java.lang.Object
  extended by edu.stanford.nlp.tagger.maxent.TestClassifier

public class TestClassifier
extends Object

Tags data and can handle either data with gold-standard tags (computing performance statistics) or unlabeled data. Also can train data using the saveModel method. This class is really the entry point to all tagger operations, it seems.

Author:
Kristina Toutanova

Constructor Summary
TestClassifier(TaggerConfig config)
           
TestClassifier(TaggerConfig config, int format)
          format can be either of 1 or 0 1 means the test file has the correct tags and is in format one word tag per line 0 means the test file does not have the correct tags and is just tokenized.
 
Method Summary
static void expandModel(String filename, String oldModelFile, int iters, String delimiter, String encoding)
           
static void iterate(String filename)
           
static void save_param(String filename, String delimiter, String encoding)
          This saves the parameters in a file like for the Improved Iterative.
static void saveModel(TaggerConfig config)
          Reads in the training corpus from a filename and trains the tagger
 void test(int format, String saveRoot, String delimiter, String encoding)
          Begin tagging.
 void test(String saveRoot, String delimiter, String encoding)
          Test on a file containing correct tags already
static void testModel(TaggerConfig config)
          Test this file with the model saved in config.getModel() + ".holder."
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestClassifier

public TestClassifier(TaggerConfig config)
               throws Exception
Throws:
Exception

TestClassifier

public TestClassifier(TaggerConfig config,
                      int format)
               throws Exception
format can be either of 1 or 0 1 means the test file has the correct tags and is in format one word tag per line 0 means the test file does not have the correct tags and is just tokenized. In this case the file is in the format one sentence per line (not ending in eos)

Parameters:
config -
format -
Throws:
Exception
Method Detail

test

public void test(int format,
                 String saveRoot,
                 String delimiter,
                 String encoding)
          throws Exception
Begin tagging. The format variable (one of 0,1) determines whether data are assumed to have gold standard tags (1) or to be unlabeled (0).

Parameters:
format -
saveRoot -
delimiter -
encoding -
Throws:
Exception

test

public void test(String saveRoot,
                 String delimiter,
                 String encoding)
          throws Exception
Test on a file containing correct tags already

Throws:
Exception

iterate

public static void iterate(String filename)

saveModel

public static void saveModel(TaggerConfig config)
                      throws Exception
Reads in the training corpus from a filename and trains the tagger

Parameters:
config - Configuration parameters for training a model (filename, etc.
Throws:
Exception

save_param

public static void save_param(String filename,
                              String delimiter,
                              String encoding)
                       throws Exception
This saves the parameters in a file like for the Improved Iterative. This calculates the model from a filename, with the specified parameters for the history and saves the result back to that filename.

Throws:
Exception

expandModel

public static void expandModel(String filename,
                               String oldModelFile,
                               int iters,
                               String delimiter,
                               String encoding)
                        throws Exception
Throws:
Exception

testModel

public static void testModel(TaggerConfig config)
                      throws Exception
Test this file with the model saved in config.getModel() + ".holder."

Parameters:
config - The tagger config
Throws:
Exception


Stanford NLP Group