Package org.coordinatekit.crf.annotator
Class AnnotatorConfiguration.Builder
java.lang.Object
org.coordinatekit.crf.annotator.AnnotatorConfiguration.Builder
- Enclosing class:
AnnotatorConfiguration
Builder for constructing
AnnotatorConfiguration instances.
input(Path) and output(Path) are required; the model is optional and the
threshold defaults to AnnotatorConfiguration.DEFAULT_THRESHOLD.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configuration with the current settings.Sets the path to the plain-text input file (UTF-8), one sequence per line.Sets the path to a serialized model.Sets the path to the XML output file; created or appended.threshold(double threshold) Sets the confidence threshold below which token rows are highlighted.
-
Method Details
-
build
Builds the configuration with the current settings.- Returns:
- an immutable configuration instance
- Throws:
IllegalStateException- if the input or output path was not set
-
input
Sets the path to the plain-text input file (UTF-8), one sequence per line.- Parameters:
input- the input file path- Returns:
- this builder
-
model
Sets the path to a serialized model. Optional; if absent the annotator runs without tag suggestions.- Parameters:
model- the model path, ornullif no model is supplied- Returns:
- this builder
-
output
Sets the path to the XML output file; created or appended.- Parameters:
output- the output file path- Returns:
- this builder
-
threshold
Sets the confidence threshold below which token rows are highlighted.- Parameters:
threshold- the threshold, in the closed interval[0.0, 1.0]- Returns:
- this builder
- Throws:
IllegalArgumentException- if the threshold isNaNor outside[0.0, 1.0]
-