April 2019
Beginner to intermediate
386 pages
11h 20m
English
The ColumnDataClassifier instance is initialized using the properties file:
ColumnDataClassifier columnDataClassifier = new ColumnDataClassifier("FlowersAndSpices.prop");
This file is duplicated in the following code sequence. It consists of several feature declarations and the names of the training and test files. These features are documented at https://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/classify/ColumnDataClassifier.html:
# FeaturesuseClassFeature=true1.usePrefixSuffixNGrams=true1.maxNGramLeng=41.minNGramLeng=1# Training inputtrainFileFlowersAndSpices.traintestFileFlowersAndSpices.test
The makeClassifier method creates the actual classifier using the training file:
Classifier<String, String> classifier ...
Read now
Unlock full access