Package org.dkpro.statistics.agreement
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>categoriesprotected java.util.List<java.lang.String>raters -
Constructor Summary
Constructors Modifier Constructor Description protectedAnnotationStudy() -
Method Summary
Modifier and Type Method Description voidaddCategory(java.lang.Object category)Adds the given category to the set of possible annotation labels.intaddRater(java.lang.String name)Add a rater with the given name.intfindRater(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.intgetCategoryCount()Returns the number of annotation categories in the study.intgetRaterCount()Returns the number of raters participating in this study.booleanisDichotomous()Returns true if, and only if, the categories defined by the study yield a dichotomy (i.e., there are exactly two categories).
-
Field Details
-
raters
protected java.util.List<java.lang.String> raters -
categories
protected java.util.Set<java.lang.Object> categories
-
-
Constructor Details
-
AnnotationStudy
protected AnnotationStudy()
-
-
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 inIAnnotationUnit. 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:
findRaterin interfaceIAnnotationStudy
-
getRaterCount
public int getRaterCount()Description copied from interface:IAnnotationStudyReturns the number of raters participating in this study.- Specified by:
getRaterCountin interfaceIAnnotationStudy
-
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:IAnnotationStudyReturns 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:
getCategoriesin interfaceIAnnotationStudy
-
getCategoryCount
public int getCategoryCount()Description copied from interface:IAnnotationStudyReturns 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:
getCategoryCountin interfaceIAnnotationStudy
-
isDichotomous
public boolean isDichotomous()Description copied from interface:IAnnotationStudyReturns true if, and only if, the categories defined by the study yield a dichotomy (i.e., there are exactly two categories).- Specified by:
isDichotomousin interfaceIAnnotationStudy
-