use of org.dkpro.statistics.agreement.coding.CohenKappaAgreement in project webanno by webanno.
the class CohenKappaAgreementMeasure method calculatePairAgreement.
@Override
public CodingAgreementResult calculatePairAgreement(Map<String, List<CAS>> aCasMap) {
AnnotationFeature feature = getFeature();
DefaultAgreementTraits traits = getTraits();
List<DiffAdapter> adapters = getDiffAdapters(annotationService, asList(feature.getLayer()));
CasDiff diff = doDiff(adapters, traits.getLinkCompareBehavior(), aCasMap);
CodingAgreementResult agreementResult = makeCodingStudy(diff, feature.getLayer().getName(), feature.getName(), true, aCasMap);
IAgreementMeasure agreement = new CohenKappaAgreement(agreementResult.getStudy());
if (agreementResult.getStudy().getItemCount() > 0) {
agreementResult.setAgreement(agreement.calculateAgreement());
} else {
agreementResult.setAgreement(Double.NaN);
}
return agreementResult;
}
Aggregations