Package org.coordinatekit.crf.annotator
Class RetokenizeConfiguration
java.lang.Object
org.coordinatekit.crf.annotator.RetokenizeConfiguration
Parser-free inputs for
RetokenizeRunner.
This immutable, builder-driven class carries the data a retokenize 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 RetokenizeCommand builds one
from picocli-parsed arguments, but any other CLI framework can build one directly and hand it to
RetokenizeRunner.run(RetokenizeConfiguration, RetokenizeRunner.ReviewerFactory).
It mirrors AnnotatorConfiguration field-for-field today; the two are kept separate so the
retokenize and annotate flows are free to diverge.
Example usage:
RetokenizeConfiguration configuration = RetokenizeConfiguration.builder()
.input(Path.of("labeled.xml"))
.output(Path.of("retagged.xml"))
.threshold(0.90)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for constructingRetokenizeConfigurationinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe default highlighting threshold used when none is set on theRetokenizeConfiguration.Builder.static final StringTheDEFAULT_THRESHOLDas a compile-timeStringfor picocli's@Option(defaultValue = ...), which requires a constant expression. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Returns a newRetokenizeConfiguration.Builderinstance for constructing a configuration.input()Returns the path to the XML training-data file to review.model()Returns the path to a serialized model, ornullif none was supplied.output()Returns the path to the XML output file; must be absent or empty, and must differ from the input.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 theRetokenizeConfiguration.Builder.- See Also:
-
DEFAULT_THRESHOLD_TEXT
TheDEFAULT_THRESHOLDas a compile-timeStringfor picocli's@Option(defaultValue = ...), which requires a constant expression. Kept in agreement withDEFAULT_THRESHOLDbyRetokenizeCommandTest.configuration__defaults.- See Also:
-
-
Method Details
-
builder
Returns a newRetokenizeConfiguration.Builderinstance for constructing a configuration.- Returns:
- a new builder with default values
-
input
Returns the path to the XML training-data file to review.- 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; the threshold drives low-confidence highlighting only when a model is supplied.- Returns:
- the model path, or
nullif no model was supplied
-
output
Returns the path to the XML output file; must be absent or empty, and must differ from the input.- 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]
-