CRFBiasedClassifier is used to adjust the precision-recall tradeoff of any CRF model implemented using CRFClassifier. This adjustment is performed after CRF training. The method is described in (Minkov, Wang, Tomasic, and Cohen, 2006): "NER Systems that Suit User's Preferences: Adjusting the Recall-Precision Trade-off for Entity Extraction". CRFBiasedClassifier can import any model serialized with {@link CRFClassifier} and supports most command-line parametersavailable in {@link CRFClassifier}. In addition to this, CRFBiasedClassifier also interprets the parameter -classBias, as in:
java -server -mx500m edu.stanford.nlp.ie.crf.CRFBiasedClassifier -loadClassifier model.gz -testFile test.txt -classBias A:0.5,B:1.5
The command above sets a bias of 0.5 towards class A and a bias of 1.5 towards class B. These biases (which internally are treated as feature weights in the log-linear model underpinning the CRF classifier) can take any real value. As the weight of A tends to plus infinity, the classifier will only predict A labels, and as it tends towards minus infinity, it will never predict A labels.
@author Michel Galley
@author Sonal Gupta (made the class generic)