Package org.coordinatekit.crf.annotator
Class AnnotatorConfiguration
java.lang.Object
org.coordinatekit.crf.annotator.AnnotatorConfiguration
Parser-free inputs for
AnnotatorRunner.
This immutable, builder-driven class carries the data an annotation run needs — the input file,
the optional model, the output file, and the highlighting threshold — without any dependency on a
particular command-line parser. The cli module's AnnotatorCommand builds one from
picocli-parsed arguments, but any other CLI framework can build one directly and hand it to
AnnotatorRunner.run(AnnotatorConfiguration, AnnotatorRunner.AnnotatorFactory).
Example usage:
AnnotatorConfiguration configuration = AnnotatorConfiguration.builder()
.input(Path.of("lines.txt"))
.output(Path.of("labeled.xml"))
.threshold(0.90)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for constructingAnnotatorConfigurationinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe default highlighting threshold used when none is set on theAnnotatorConfiguration.Builder.static final StringTheDEFAULT_THRESHOLDas a compile-timeStringfor picocli's@Option(defaultValue = ...), which requires a constant expression. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a newAnnotatorConfiguration.Builderinstance for constructing a configuration.input()Returns the path to the plain-text input file (UTF-8), one sequence per line.model()Returns the path to a serialized model, ornullif none was supplied.output()Returns the path to the XML output file; created or appended.doubleReturns the confidence threshold below which token rows are highlighted on the sequence screen.
-
Field Details
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDThe default highlighting threshold used when none is set on theAnnotatorConfiguration.Builder.- See Also:
-
DEFAULT_THRESHOLD_TEXT
TheDEFAULT_THRESHOLDas a compile-timeStringfor picocli's@Option(defaultValue = ...), which requires a constant expression. Kept in agreement withDEFAULT_THRESHOLDbyAnnotatorCommandTest.configuration__defaults.- See Also:
-
-
Method Details
-
builder
Returns a newAnnotatorConfiguration.Builderinstance for constructing a configuration.- Returns:
- a new builder with default values
-
input
Returns the path to the plain-text input file (UTF-8), one sequence per line.- Returns:
- the input file path
-
model
Returns the path to a serialized model, ornullif none was supplied. The factory decides how to materialize aCrfTaggerfrom this path.- Returns:
- the model path, or
nullif no model was supplied
-
output
Returns the path to the XML output file; created or appended.- Returns:
- the output file path
-
threshold
public double threshold()Returns the confidence threshold below which token rows are highlighted on the sequence screen.- Returns:
- the threshold, in the closed interval
[0.0, 1.0]
-