Class ParserEvaluator

java.lang.Object
opennlp.tools.util.eval.Evaluator<Parse>
opennlp.tools.parser.ParserEvaluator

public class ParserEvaluator extends Evaluator<Parse>
This implementation of Evaluator<Parse> behaves like EVALB with no exceptions, e.g, without removing punctuation tags, or equality between ADVP and PRT, as in COLLINS convention.

To follow parsing evaluation conventions (Bikel, Collins, Charniak, etc.) as in EVALB, options are to be added to the ParserEvaluatorTool.

See Also:
  • Field Details

    • fmeasure

      private final FMeasure fmeasure
    • parser

      private final Parser parser
  • Constructor Details

  • Method Details

    • getConstituencySpans

      private static Span[] getConstituencySpans(Parse parse)
      Obtains spans for every parse in a sentence.
      Parameters:
      parse - The parse from which to obtain spans.
      Returns:
      An array of spans for the parse
    • processSample

      protected final Parse processSample(Parse reference)
      Description copied from class: Evaluator
      Evaluates the given reference T sample object.

      The implementation has to update the score after every invocation.

      Specified by:
      processSample in class Evaluator<Parse>
      Parameters:
      reference - A reference sample.
      Returns:
      The predicted sample.
    • getFMeasure

      public final FMeasure getFMeasure()