Class AnnotatorConfiguration

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

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

  • Method Details

    • builder

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

      public Path input()
      Returns the path to the plain-text input file (UTF-8), one sequence per line.
      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.
      Returns:
      the model path, or null if no model was supplied
    • output

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