Search in sources :

Example 56 with DiffResult

use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult in project webanno by webanno.

the class CasDiff2Test method relationLabelTest.

@Test
public void relationLabelTest() throws Exception {
    Map<String, List<JCas>> casByUser = DiffUtils.load("casdiff/relationLabel/user1.conll", "casdiff/relationLabel/user2.conll");
    List<String> entryTypes = asList(Dependency.class.getName());
    List<? extends DiffAdapter> diffAdapters = asList(new ArcDiffAdapter(Dependency.class.getName(), "Dependent", "Governor", "DependencyType"));
    DiffResult result = CasDiff2.doDiff(entryTypes, diffAdapters, LinkCompareBehavior.LINK_TARGET_AS_LABEL, casByUser);
    result.print(System.out);
    assertEquals(26, result.size());
    assertEquals(1, result.getDifferingConfigurationSets().size());
    assertEquals(0, result.getIncompleteConfigurationSets().size());
    AgreementResult agreement = AgreementUtils.getCohenKappaAgreement(result, entryTypes.get(0), "DependencyType", casByUser);
    assertEquals(0.958199d, agreement.getAgreement(), 0.000001d);
    assertEquals(0, agreement.getIncompleteSetsByPosition().size());
}
Also used : AgreementResult(de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult) ArcDiffAdapter(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.ArcDiffAdapter) 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)

Aggregations

DiffResult (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.DiffResult)53 List (java.util.List)53 Arrays.asList (java.util.Arrays.asList)52 Test (org.junit.Test)51 ArrayList (java.util.ArrayList)49 JCas (org.apache.uima.jcas.JCas)45 SpanDiffAdapter (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.SpanDiffAdapter)37 LinkedHashMap (java.util.LinkedHashMap)27 AgreementResult (de.tudarmstadt.ukp.clarin.webanno.curation.agreement.AgreementUtils.AgreementResult)24 POS (de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS)20 ArcDiffAdapter (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.ArcDiffAdapter)13 Type (org.apache.uima.cas.Type)12 Dependency (de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency.Dependency)11 Map (java.util.Map)9 HashMap (java.util.HashMap)8 SourceDocument (de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument)6 FeatureStructure (org.apache.uima.cas.FeatureStructure)6 User (de.tudarmstadt.ukp.clarin.webanno.security.model.User)5 AnnotationFS (org.apache.uima.cas.text.AnnotationFS)5 TypeSystemDescription (org.apache.uima.resource.metadata.TypeSystemDescription)5