Interface EvaluationRenderer<T extends Output<T>,E extends Evaluation<T>>

Type Parameters:
T - type of output
E - type of evaluation
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EvaluationRenderer<T extends Output<T>,E extends Evaluation<T>>
Renders an Evaluation into a String.

For example, an implementation might produce

  • Method Summary

    Modifier and Type
    Method
    Description
    apply(E evaluation)
    Convert the evaluation to a string.
  • Method Details

    • apply

      String apply(E evaluation)
      Convert the evaluation to a string. For example:
           EvaluationRenderer<Label, LabelEvaluation> renderer = (LabelEvaluation eval) -> {
               StringBuilder sb = new StringBuilder();
               sb.append(String.format("macro F1: %.2f", eval.macroAveragedF1()));
               sb.append(String.format("micro F1: %.2f", eval.microAveragedF1()));
               return sb.toString();
           }
      
           LabelEvaluation evaluation = ...
           System.out.println(renderer.apply(evaluation));
       
      Parameters:
      evaluation - The evaluation to render.
      Returns:
      The renderer's representation of the evaluation as a String.