Class RetokenizeConfiguration

java.lang.Object
org.coordinatekit.crf.annotator.RetokenizeConfiguration

@NullMarked public final class RetokenizeConfiguration extends Object
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:
  • Field Details

  • Method Details

    • builder

      public static RetokenizeConfiguration.Builder builder()
      Returns a new RetokenizeConfiguration.Builder instance for constructing a configuration.
      Returns:
      a new builder with default values
    • input

      public Path input()
      Returns the path to the XML training-data file to review.
      Returns:
      the input file path
    • model

      public @Nullable Path model()
      Returns the path to a serialized model, or null if none was supplied. The factory decides how to materialize a CrfTagger from this path; the threshold drives low-confidence highlighting only when a model is supplied.
      Returns:
      the model path, or null if no model was supplied
    • output

      public Path 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]