Class AnnotationStudy

java.lang.Object
org.dkpro.statistics.agreement.AnnotationStudy
All Implemented Interfaces:
java.io.Serializable, IAnnotationStudy
Direct Known Subclasses:
CodingAnnotationStudy, UnitizingAnnotationStudy

public abstract class AnnotationStudy
extends java.lang.Object
implements IAnnotationStudy
Default implementation of the IAnnotationStudy interface. Abstract base class for coding and unitizing annotation studies.
Author:
Christian M. Meyer
See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Set<java.lang.Object> categories  
    protected java.util.List<java.lang.String> raters  
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected AnnotationStudy()  
  • Method Summary

    Modifier and Type Method Description
    void addCategory​(java.lang.Object category)
    Adds the given category to the set of possible annotation labels.
    int addRater​(java.lang.String name)
    Add a rater with the given name.
    int findRater​(java.lang.String name)
    Find the index of the rater with the given name.
    java.lang.Iterable<java.lang.Object> getCategories()
    Returns an iterator over all annotation categories within the study.
    int getCategoryCount()
    Returns the number of annotation categories in the study.
    int getRaterCount()
    Returns the number of raters participating in this study.
    boolean isDichotomous()
    Returns true if, and only if, the categories defined by the study yield a dichotomy (i.e., there are exactly two categories).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.dkpro.statistics.agreement.IAnnotationStudy

    getUnitCount
  • Field Details

    • raters

      protected java.util.List<java.lang.String> raters
    • categories

      protected java.util.Set<java.lang.Object> categories
  • Constructor Details

  • Method Details

    • addRater

      public int addRater​(java.lang.String name)
      Add a rater with the given name. Returns the index of the newly added rater which is required to identify the rater in IAnnotationUnit. The first rater receives index 0. Note that adding names for the raters is optional.
    • findRater

      public int findRater​(java.lang.String name)
      Find the index of the rater with the given name.
      Specified by:
      findRater in interface IAnnotationStudy
    • getRaterCount

      public int getRaterCount()
      Description copied from interface: IAnnotationStudy
      Returns the number of raters participating in this study.
      Specified by:
      getRaterCount in interface IAnnotationStudy
    • addCategory

      public void addCategory​(java.lang.Object category)
      Adds the given category to the set of possible annotation labels. This method is only required of a category has not been used by any rater of within the annotation study.
      Throws:
      java.lang.NullPointerException - if the specified category is null.
    • getCategories

      public java.lang.Iterable<java.lang.Object> getCategories()
      Description copied from interface: IAnnotationStudy
      Returns an iterator over all annotation categories within the study. Note that the categories are not per se clear; they might need to be gathered by iterating through all associated items, which yields performance problems in large-scale annotation studies.
      Specified by:
      getCategories in interface IAnnotationStudy
    • getCategoryCount

      public int getCategoryCount()
      Description copied from interface: IAnnotationStudy
      Returns the number of annotation categories in the study. Note that the categories are not per se clear; they might need to be gathered by iterating through all associated items, which yields performance problems in large-scale annotation studies.
      Specified by:
      getCategoryCount in interface IAnnotationStudy
    • isDichotomous

      public boolean isDichotomous()
      Description copied from interface: IAnnotationStudy
      Returns true if, and only if, the categories defined by the study yield a dichotomy (i.e., there are exactly two categories).
      Specified by:
      isDichotomous in interface IAnnotationStudy