Search in sources :

Example 1 with AgreementResult

use of de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult in project webanno by webanno.

the class CasDiff2Test method noDifferencesDependencyTest.

@Test
public void noDifferencesDependencyTest() throws Exception {
    Map<String, List<JCas>> casByUser = DiffUtils.load("casdiff/noDifferences/data.conll", "casdiff/noDifferences/data.conll");
    List<String> entryTypes = asList(Dependency.class.getName());
    List<? extends DiffAdapter> diffAdapters = asList(ArcDiffAdapter.DEPENDENCY);
    DiffResult result = CasDiff2.doDiff(entryTypes, diffAdapters, LinkCompareBehavior.LINK_TARGET_AS_LABEL, casByUser);
    result.print(System.out);
    assertEquals(26, result.size());
    assertEquals(0, result.getDifferingConfigurationSets().size());
    assertEquals(0, result.getIncompleteConfigurationSets().size());
    AgreementResult agreement = AgreementUtils.getCohenKappaAgreement(result, entryTypes.get(0), "DependencyType", casByUser);
    assertEquals(1.0d, agreement.getAgreement(), 0.000001d);
    assertEquals(0, agreement.getIncompleteSetsByPosition().size());
}
Also used : AgreementResult(de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult) ArrayList(java.util.ArrayList) Arrays.asList(java.util.Arrays.asList) List(java.util.List) Dependency(de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency.Dependency) DiffResult(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult) Test(org.junit.Test)

Example 2 with AgreementResult

use of de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult in project webanno by webanno.

the class CasDiff2Test method noDifferencesPosDependencyTest.

@Test
public void noDifferencesPosDependencyTest() throws Exception {
    Map<String, List<JCas>> casByUser = DiffUtils.load("casdiff/noDifferences/data.conll", "casdiff/noDifferences/data.conll");
    List<String> entryTypes = asList(POS.class.getName(), Dependency.class.getName());
    List<? extends DiffAdapter> diffAdapters = asList(SpanDiffAdapter.POS, ArcDiffAdapter.DEPENDENCY);
    DiffResult result = CasDiff2.doDiff(entryTypes, diffAdapters, LinkCompareBehavior.LINK_TARGET_AS_LABEL, casByUser);
    result.print(System.out);
    assertEquals(52, result.size());
    assertEquals(26, result.size(POS.class.getName()));
    assertEquals(26, result.size(Dependency.class.getName()));
    assertEquals(0, result.getDifferingConfigurationSets().size());
    assertEquals(0, result.getIncompleteConfigurationSets().size());
    AgreementResult agreement = AgreementUtils.getCohenKappaAgreement(result, entryTypes.get(0), "PosValue", casByUser);
    assertEquals(1.0d, agreement.getAgreement(), 0.000001d);
    assertEquals(0, agreement.getIncompleteSetsByPosition().size());
}
Also used : AgreementResult(de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult) POS(de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS) ArrayList(java.util.ArrayList) Arrays.asList(java.util.Arrays.asList) List(java.util.List) Dependency(de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency.Dependency) DiffResult(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult) Test(org.junit.Test)

Example 3 with AgreementResult

use of de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult in project webanno by webanno.

the class CasDiff2Test method noDifferencesPosTest.

@Test
public void noDifferencesPosTest() throws Exception {
    Map<String, List<JCas>> casByUser = DiffUtils.load("casdiff/noDifferences/data.conll", "casdiff/noDifferences/data.conll");
    List<String> entryTypes = asList(POS.class.getName());
    List<SpanDiffAdapter> diffAdapters = asList(SpanDiffAdapter.POS);
    DiffResult result = CasDiff2.doDiff(entryTypes, diffAdapters, LinkCompareBehavior.LINK_TARGET_AS_LABEL, casByUser);
    result.print(System.out);
    assertEquals(26, result.size());
    assertEquals(0, result.getDifferingConfigurationSets().size());
    assertEquals(0, result.getIncompleteConfigurationSets().size());
    AgreementResult agreement = AgreementUtils.getCohenKappaAgreement(result, entryTypes.get(0), "PosValue", casByUser);
    assertEquals(1.0d, agreement.getAgreement(), 0.000001d);
    assertEquals(0, agreement.getIncompleteSetsByPosition().size());
}
Also used : AgreementResult(de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult) POS(de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS) SpanDiffAdapter(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.SpanDiffAdapter) ArrayList(java.util.ArrayList) Arrays.asList(java.util.Arrays.asList) List(java.util.List) DiffResult(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult) Test(org.junit.Test)

Example 4 with AgreementResult

use of de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult in project webanno by webanno.

the class CasDiff2Test method someDifferencesTest.

@Test
public void someDifferencesTest() throws Exception {
    Map<String, List<JCas>> casByUser = DiffUtils.load("casdiff/someDifferences/user1.conll", "casdiff/someDifferences/user2.conll");
    List<String> entryTypes = asList(POS.class.getName());
    List<SpanDiffAdapter> diffAdapters = asList(SpanDiffAdapter.POS);
    DiffResult result = CasDiff2.doDiff(entryTypes, diffAdapters, LinkCompareBehavior.LINK_TARGET_AS_LABEL, casByUser);
    result.print(System.out);
    assertEquals(26, result.size());
    assertEquals(4, result.getDifferingConfigurationSets().size());
    assertEquals(0, result.getIncompleteConfigurationSets().size());
    AgreementResult agreement = AgreementUtils.getCohenKappaAgreement(result, entryTypes.get(0), "PosValue", casByUser);
    assertEquals(0.836477987d, agreement.getAgreement(), 0.000001d);
    assertEquals(0, agreement.getIncompleteSetsByPosition().size());
}
Also used : AgreementResult(de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult) POS(de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS) SpanDiffAdapter(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.SpanDiffAdapter) ArrayList(java.util.ArrayList) Arrays.asList(java.util.Arrays.asList) List(java.util.List) DiffResult(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult) Test(org.junit.Test)

Example 5 with AgreementResult

use of de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult in project webanno by webanno.

the class CasDiff2Test method singleNoDifferencesTest.

@Test
public void singleNoDifferencesTest() throws Exception {
    Map<String, List<JCas>> casByUser = DiffUtils.load("casdiff/singleSpanNoDifference/data.conll", "casdiff/singleSpanNoDifference/data.conll");
    List<String> entryTypes = asList(POS.class.getName());
    List<? extends DiffAdapter> diffAdapters = asList(new SpanDiffAdapter(POS.class.getName(), "PosValue"));
    DiffResult result = CasDiff2.doDiff(entryTypes, diffAdapters, LinkCompareBehavior.LINK_TARGET_AS_LABEL, casByUser);
    result.print(System.out);
    assertEquals(1, result.size());
    assertEquals(0, result.getDifferingConfigurationSets().size());
    assertEquals(0, result.getIncompleteConfigurationSets().size());
    AgreementResult agreement = AgreementUtils.getCohenKappaAgreement(result, entryTypes.get(0), "PosValue", casByUser);
    assertEquals(Double.NaN, agreement.getAgreement(), 0.000001d);
    assertEquals(0, agreement.getIncompleteSetsByPosition().size());
}
Also used : AgreementResult(de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult) POS(de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS) SpanDiffAdapter(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.SpanDiffAdapter) ArrayList(java.util.ArrayList) Arrays.asList(java.util.Arrays.asList) List(java.util.List) DiffResult(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult) Test(org.junit.Test)

Aggregations

AgreementResult (de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult)25 DiffResult (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult)24 Arrays.asList (java.util.Arrays.asList)24 List (java.util.List)24 Test (org.junit.Test)24 ArrayList (java.util.ArrayList)19 SpanDiffAdapter (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.SpanDiffAdapter)16 LinkedHashMap (java.util.LinkedHashMap)15 JCas (org.apache.uima.jcas.JCas)15 POS (de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS)11 Dependency (de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency.Dependency)7 ArcDiffAdapter (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.ArcDiffAdapter)5 SourceDocument (de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument)5 User (de.tudarmstadt.ukp.clarin.webanno.security.model.User)5 HashMap (java.util.HashMap)5 Map (java.util.Map)5 Lemma (de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma)2 AJAXDownload (de.tudarmstadt.ukp.clarin.webanno.support.AJAXDownload)1 NamedEntity (de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity)1 Sentence (de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence)1