use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class TwoPairedKappaTest method testTwoUserDiffSpanAnnotation.
@Test
public void testTwoUserDiffSpanAnnotation() throws Exception {
Map<User, List<SourceDocument>> userDocs = new HashMap<>();
userDocs.put(user1, asList(document));
userDocs.put(user2, asList(document));
Map<User, CAS> userCases = new HashMap<>();
userCases.put(user1, kappatestCas);
userCases.put(user2, kappaspandiff);
Map<SourceDocument, Map<User, CAS>> documentJCases = new HashMap<>();
documentJCases.put(document, userCases);
// Check against new impl
CasDiff diff = doDiff(asList(POS_DIFF_ADAPTER), LINK_TARGET_AS_LABEL, convert(userCases));
DiffResult result = diff.toResult();
AgreementResult agreement = getCohenKappaAgreement(diff, POS.class.getName(), "PosValue", convert(userCases));
// Asserts
System.out.printf("Agreement: %s%n", agreement.toString());
result.print(System.out);
assertEquals(0.86153d, agreement.getAgreement(), 0.00001d);
assertEquals(9, result.size());
assertEquals(1, result.getDifferingConfigurationSets().size());
assertEquals(0, result.getIncompleteConfigurationSets().size());
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class TwoPairedKappaTest method testTwoUserDiffArcAndSpanAnnotation.
@Test
public void testTwoUserDiffArcAndSpanAnnotation() throws Exception {
Map<User, List<SourceDocument>> userDocs = new HashMap<>();
userDocs.put(user1, asList(document));
userDocs.put(user2, asList(document));
Map<User, CAS> userCases = new HashMap<>();
userCases.put(user1, kappatestCas);
userCases.put(user2, kappaspanarcdiff);
Map<SourceDocument, Map<User, CAS>> documentJCases = new HashMap<>();
documentJCases.put(document, userCases);
// Check against new impl
CasDiff diff = doDiff(asList(DEPENDENCY_DIFF_ADAPTER), LINK_TARGET_AS_LABEL, convert(userCases));
DiffResult result = diff.toResult();
CodingAgreementResult agreement = getCohenKappaAgreement(diff, Dependency.class.getName(), "DependencyType", convert(userCases));
// Asserts
System.out.printf("Agreement: %s%n", agreement.toString());
result.print(System.out);
AgreementUtils.dumpAgreementStudy(System.out, agreement);
assertEquals(0.86153d, agreement.getAgreement(), 0.00001d);
assertEquals(9, result.size());
assertEquals(1, result.getDifferingConfigurationSets().size());
assertEquals(0, result.getIncompleteConfigurationSets().size());
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class TwoPairedKappaTest method testTwoUserDiffArcAnnotation.
@Test
public void testTwoUserDiffArcAnnotation() throws Exception {
Map<User, List<SourceDocument>> userDocs = new HashMap<>();
userDocs.put(user1, asList(document));
userDocs.put(user2, asList(document));
Map<User, CAS> userCases = new HashMap<>();
userCases.put(user1, kappatestCas);
userCases.put(user2, kappaarcdiff);
Map<SourceDocument, Map<User, CAS>> documentJCases = new HashMap<>();
documentJCases.put(document, userCases);
// Check against new impl
CasDiff diff = doDiff(asList(DEPENDENCY_DIFF_ADAPTER), LINK_TARGET_AS_LABEL, convert(userCases));
DiffResult result = diff.toResult();
AgreementResult agreement = getCohenKappaAgreement(diff, Dependency.class.getName(), "DependencyType", convert(userCases));
// Asserts
System.out.printf("Agreement: %s%n", agreement.toString());
result.print(System.out);
assertEquals(0.86153d, agreement.getAgreement(), 0.00001d);
assertEquals(9, result.size());
assertEquals(1, result.getDifferingConfigurationSets().size());
assertEquals(0, result.getIncompleteConfigurationSets().size());
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class TwoPairedKappaTest method testTwoUserSameAnnotation.
@Test
public void testTwoUserSameAnnotation() throws Exception {
Map<User, List<SourceDocument>> userDocs = new HashMap<>();
userDocs.put(user1, asList(document));
userDocs.put(user2, asList(document));
Map<User, CAS> userCases = new HashMap<>();
userCases.put(user1, kappatestCas);
userCases.put(user2, kappatestCas);
Map<SourceDocument, Map<User, CAS>> documentJCases = new HashMap<>();
documentJCases.put(document, userCases);
// Check against new impl
CasDiff diff = doDiff(asList(POS_DIFF_ADAPTER), LINK_TARGET_AS_LABEL, convert(userCases));
DiffResult result = diff.toResult();
AgreementResult agreement = getCohenKappaAgreement(diff, POS.class.getName(), "PosValue", convert(userCases));
// Asserts
System.out.printf("Agreement: %s%n", agreement.toString());
result.print(System.out);
assertEquals(1.0d, agreement.getAgreement(), 0.000001);
assertEquals(9, result.size());
assertEquals(0, result.getDifferingConfigurationSets().size());
assertEquals(0, result.getIncompleteConfigurationSets().size());
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff.DiffResult in project webanno by webanno.
the class CohenKappaAgreementMeasureTest 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);
}
Aggregations