LBJ2.nlp.seg
Class BIOTester

java.lang.Object
  extended by LBJ2.nlp.seg.BIOTester

public class BIOTester
extends java.lang.Object

This class may be used to produce a detailed report of the segment by segment performance of a given classifier on given labeled testing data. Segment by segment performance is computed by using a specified Token classifier to induce the predicted segments, and then computing precision, recall, and F1 measures on those segments. A predicted segment is judged as different than a labeled segment if the two segments start or end at different Tokens, or if they have different types.

It is assumed that both of the specified Token classifiers (one giving labels and the other giving predictions) produce discrete predicitions of the form B-type, I-type, and O to represent the beginning of a segment of type type, a token inside a segment of type type, and a token outside of any segment respectively.

It is also assumed that the specified Parser produces Tokens linked to each other via the previous and next fields inherited from LinkedChild. In order to invoke this class as a program on the command line, it must also be the case that the parser implements a constructor with a single String argument.

Command Line Usage

java LBJ2.nlp.seg.BIOTester <classifier> <labeler> <parser> <test file>

Input

The first three arguments must be fully qualified class names. The fourth is the name of a file containing labeled testing data to be parsed by the parser.

Output

The output is generated by the TestDiscrete class.


Field Summary
protected  Classifier classifier
          A BIO classifier that classifies Tokens.
protected  Classifier labeler
          A BIO classifier that produces the true labels of the Tokens.
protected  Parser parser
          A parser that produces Tokens.
 
Constructor Summary
BIOTester(Classifier c, Classifier l, Parser p)
          Initializing constructor.
 
Method Summary
static void main(java.lang.String[] args)
          The command line program simply instantiates an object of this class and calls its test() method.
 TestDiscrete test()
          This method runs the tester, packaging the results in a TestDiscrete object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classifier

protected Classifier classifier
A BIO classifier that classifies Tokens.


labeler

protected Classifier labeler
A BIO classifier that produces the true labels of the Tokens.


parser

protected Parser parser
A parser that produces Tokens.

Constructor Detail

BIOTester

public BIOTester(Classifier c,
                 Classifier l,
                 Parser p)
Initializing constructor.

Parameters:
c - The value for classifier.
l - The value for labeler.
p - The value for parser.
Method Detail

test

public TestDiscrete test()
This method runs the tester, packaging the results in a TestDiscrete object.

Returns:
The performance results.

main

public static void main(java.lang.String[] args)
The command line program simply instantiates an object of this class and calls its test() method.