use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class KrippendorffAlphaNominalAgreementMeasureTest method twoEmptyCasTest.
@Test
public void twoEmptyCasTest() throws Exception {
PairwiseAnnotationResult<CodingAgreementResult> agreement = twoEmptyCasTest(sut);
CodingAgreementResult result = agreement.getStudy("user1", "user2");
DiffResult diff = result.getDiff();
assertEquals(0, diff.size());
assertEquals(0, diff.getDifferingConfigurationSets().size());
assertEquals(0, diff.getIncompleteConfigurationSets().size());
assertEquals(NaN, result.getAgreement(), 0.000001d);
assertEquals(0, result.getIncompleteSetsByPosition().size());
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class FleissKappaAgreementMeasureTest method twoEmptyCasTest.
@Test
public void twoEmptyCasTest() throws Exception {
PairwiseAnnotationResult<CodingAgreementResult> agreement = twoEmptyCasTest(sut);
CodingAgreementResult result = agreement.getStudy("user1", "user2");
DiffResult diff = result.getDiff();
assertEquals(0, diff.size());
assertEquals(0, diff.getDifferingConfigurationSets().size());
assertEquals(0, diff.getIncompleteConfigurationSets().size());
assertEquals(NaN, result.getAgreement(), 0.000001d);
assertEquals(0, result.getIncompleteSetsByPosition().size());
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class FleissKappaAgreementMeasureTest method multiLinkWithRoleLabelDifference.
@Test
public void multiLinkWithRoleLabelDifference() throws Exception {
PairwiseAnnotationResult<CodingAgreementResult> agreement = multiLinkWithRoleLabelDifferenceTest(sut);
CodingAgreementResult result = agreement.getStudy("user1", "user2");
DiffResult diff = result.getDiff();
diff.print(System.out);
assertEquals(3, diff.size());
assertEquals(0, diff.getDifferingConfigurationSets().size());
assertEquals(2, diff.getIncompleteConfigurationSets().size());
assertEquals(NaN, result.getAgreement(), 0.00001d);
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class TwoPairedKappaTest method testThreeUserDiffArcAndSpanAnnotation.
@Test
public void testThreeUserDiffArcAndSpanAnnotation() throws Exception {
Map<User, List<SourceDocument>> userDocs = new HashMap<>();
userDocs.put(user1, asList(document));
userDocs.put(user2, asList(document));
userDocs.put(user3, asList(document));
Map<User, CAS> userCases = new HashMap<>();
userCases.put(user1, kappatestCas);
userCases.put(user2, kappaspandiff);
userCases.put(user3, kappaspanarcdiff);
Map<SourceDocument, Map<User, CAS>> documentJCases = new HashMap<>();
documentJCases.put(document, userCases);
// Check against new impl
CasDiff diff = doDiff(asList(POS_DIFF_ADAPTER, DEPENDENCY_DIFF_ADAPTER), LINK_TARGET_AS_LABEL, convert(userCases));
DiffResult result = diff.toResult();
Map<String, List<CAS>> user1and2 = convert(userCases);
user1and2.remove("user3");
AgreementResult agreement12 = getCohenKappaAgreement(diff, Dependency.class.getName(), "DependencyType", user1and2);
Map<String, List<CAS>> user2and3 = convert(userCases);
user2and3.remove("user1");
AgreementResult agreement23 = getCohenKappaAgreement(diff, Dependency.class.getName(), "DependencyType", user2and3);
Map<String, List<CAS>> user1and3 = convert(userCases);
user1and3.remove("user2");
AgreementResult agreement13 = getCohenKappaAgreement(diff, Dependency.class.getName(), "DependencyType", user1and3);
// Asserts
result.print(System.out);
System.out.printf("New agreement 1/2: %s%n", agreement12.toString());
System.out.printf("New agreement 2/3: %s%n", agreement23.toString());
System.out.printf("New agreement 1/3: %s%n", agreement13.toString());
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class CasDiffTest method noDataTest.
@Test
public void noDataTest() throws Exception {
List<DiffAdapter> diffAdapters = new ArrayList<>();
Map<String, List<CAS>> casByUser = new LinkedHashMap<>();
DiffResult result = doDiff(diffAdapters, LINK_TARGET_AS_LABEL, casByUser).toResult();
// result.print(System.out);
assertEquals(0, result.size());
assertEquals(0, result.getDifferingConfigurationSets().size());
assertEquals(0, result.getIncompleteConfigurationSets().size());
}
Aggregations