Class FineGrainedReportListener

java.lang.Object
opennlp.tools.cmdline.FineGrainedReportListener
Direct Known Subclasses:
DoccatFineGrainedReportListener, LanguageDetectorFineGrainedReportListener, LemmatizerFineGrainedReportListener, POSTaggerFineGrainedReportListener, TokenNameFinderFineGrainedReportListener

public abstract class FineGrainedReportListener extends Object
  • Field Details

  • Constructor Details

    • FineGrainedReportListener

      public FineGrainedReportListener(PrintStream printStream)
    • FineGrainedReportListener

      public FineGrainedReportListener(OutputStream outputStream)
      Writes the report to the OutputStream. Should be called only after the evaluation process.
  • Method Details

    • generateAlphaLabel

      private static String generateAlphaLabel(int index)
    • writeReport

      public abstract void writeReport()
    • getStats

      protected FineGrainedReportListener.Stats getStats()
    • getNumberOfSentences

      private long getNumberOfSentences()
    • getAverageSentenceSize

      private double getAverageSentenceSize()
    • getMinSentenceSize

      private int getMinSentenceSize()
    • getMaxSentenceSize

      private int getMaxSentenceSize()
    • getNumberOfTags

      private int getNumberOfTags()
    • getAccuracy

      private double getAccuracy()
    • getTokenAccuracy

      private double getTokenAccuracy(String token)
    • getTokensOrderedByFrequency

      private SortedSet<String> getTokensOrderedByFrequency()
    • getTokenFrequency

      private int getTokenFrequency(String token)
    • getTokenErrors

      private int getTokenErrors(String token)
    • getTokensOrderedByNumberOfErrors

      private SortedSet<String> getTokensOrderedByNumberOfErrors()
    • getTagsOrderedByErrors

      private SortedSet<String> getTagsOrderedByErrors()
    • getTagFrequency

      private int getTagFrequency(String tag)
    • getTagErrors

      private int getTagErrors(String tag)
    • getTagPrecision

      private double getTagPrecision(String tag)
    • getTagRecall

      private double getTagRecall(String tag)
    • getTagFMeasure

      private double getTagFMeasure(String tag)
    • getConfusionMatrixTagset

      private SortedSet<String> getConfusionMatrixTagset()
    • getConfusionMatrixTagset

      private SortedSet<String> getConfusionMatrixTagset(String token)
    • formatNumber

      private static String formatNumber(String pattern, Object value)
      Applies a MessageFormat number pattern using Locale.ROOT, so that the figures in a report stay identical regardless of the JVM's default Locale.
      Parameters:
      pattern - The MessageFormat pattern to apply.
      value - The value to format.
      Returns:
      The formatted value.
    • getConfusionMatrix

      private double[][] getConfusionMatrix()
    • getConfusionMatrix

      private double[][] getConfusionMatrix(String token)
    • matrixToString

      private String matrixToString(SortedSet<String> tagset, double[][] data, boolean filter)
    • printGeneralStatistics

      protected void printGeneralStatistics()
    • printTokenOccurrencesRank

      protected void printTokenOccurrencesRank()
    • printTokenErrorRank

      protected void printTokenErrorRank()
    • printTagsErrorRank

      protected void printTagsErrorRank()
    • printGeneralConfusionTable

      protected void printGeneralConfusionTable()
    • printDetailedConfusionMatrix

      protected void printDetailedConfusionMatrix()
    • printHeader

      private void printHeader(String text)
      Auxiliary method that prints a emphasised report header
    • printFooter

      private void printFooter(String text)
      Auxiliary method that prints a marker to the end of a report
    • printLine

      private void printLine(int size)
      Auxiliary method that prints a horizontal line of a given size
    • getMatrixLabelComparator

      public Comparator<String> getMatrixLabelComparator(Map<String, FineGrainedReportListener.ConfusionMatrixLine> confusionMatrix)
    • getLabelComparator

      public Comparator<String> getLabelComparator(Map<String, FineGrainedReportListener.Counter> map)