use of de.tudarmstadt.ukp.clarin.webanno.agreement.PairwiseAnnotationResult in project webanno by webanno.
the class KrippendorffAlphaUnitizingAgreementMeasure method getAgreement.
@Override
public PairwiseAnnotationResult<UnitizingAgreementResult> getAgreement(Map<String, List<CAS>> aCasMap) {
PairwiseAnnotationResult<UnitizingAgreementResult> result = new PairwiseAnnotationResult<>(getFeature(), getTraits());
List<Entry<String, List<CAS>>> entryList = new ArrayList<>(aCasMap.entrySet());
for (int m = 0; m < entryList.size(); m++) {
for (int n = 0; n < entryList.size(); n++) {
// Triangle matrix mirrored
if (n < m) {
Map<String, List<CAS>> pairwiseCasMap = new LinkedHashMap<>();
pairwiseCasMap.put(entryList.get(m).getKey(), entryList.get(m).getValue());
pairwiseCasMap.put(entryList.get(n).getKey(), entryList.get(n).getValue());
UnitizingAgreementResult res = calculatePairAgreement(pairwiseCasMap);
result.add(entryList.get(m).getKey(), entryList.get(n).getKey(), res);
}
}
}
return result;
}
Aggregations