Search in sources :

Example 1 with FleissKappaAgreement

use of org.dkpro.statistics.agreement.coding.FleissKappaAgreement in project webanno by webanno.

the class FleissKappaAgreementMeasure 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 FleissKappaAgreement(agreementResult.getStudy());
    if (agreementResult.getStudy().getItemCount() > 0) {
        agreementResult.setAgreement(agreement.calculateAgreement());
    } else {
        agreementResult.setAgreement(Double.NaN);
    }
    return agreementResult;
}
Also used : CodingAgreementResult(de.tudarmstadt.ukp.clarin.webanno.agreement.results.coding.CodingAgreementResult) IAgreementMeasure(org.dkpro.statistics.agreement.IAgreementMeasure) FleissKappaAgreement(org.dkpro.statistics.agreement.coding.FleissKappaAgreement) CasDiff(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff) DefaultAgreementTraits(de.tudarmstadt.ukp.clarin.webanno.agreement.measures.DefaultAgreementTraits) DiffAdapter(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.api.DiffAdapter) AnnotationFeature(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature)

Aggregations

DefaultAgreementTraits (de.tudarmstadt.ukp.clarin.webanno.agreement.measures.DefaultAgreementTraits)1 CodingAgreementResult (de.tudarmstadt.ukp.clarin.webanno.agreement.results.coding.CodingAgreementResult)1 CasDiff (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff)1 DiffAdapter (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.api.DiffAdapter)1 AnnotationFeature (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature)1 IAgreementMeasure (org.dkpro.statistics.agreement.IAgreementMeasure)1 FleissKappaAgreement (org.dkpro.statistics.agreement.coding.FleissKappaAgreement)1