Search in sources :

Example 1 with IAnnotationUnit

use of de.tudarmstadt.ukp.dkpro.statistics.agreement.IAnnotationUnit in project webanno by webanno.

the class AgreementUtils method configurationSetsWithItemsToCsv.

private static void configurationSetsWithItemsToCsv(CSVPrinter aOut, AgreementResult aAgreement, List<ConfigurationSet> aSets) throws IOException {
    List<String> headers = new ArrayList<>(asList("Type", "Collection", "Document", "Layer", "Feature", "Position"));
    headers.addAll(aAgreement.getCasGroupIds());
    aOut.printRecord(headers);
    int i = 0;
    for (ICodingAnnotationItem item : aAgreement.getStudy().getItems()) {
        Position pos = aSets.get(i).getPosition();
        List<String> values = new ArrayList<>();
        values.add(pos.getClass().getSimpleName());
        values.add(pos.getCollectionId());
        values.add(pos.getDocumentId());
        values.add(pos.getType());
        values.add(aAgreement.getFeature());
        values.add(aSets.get(i).getPosition().toMinimalString());
        for (IAnnotationUnit unit : item.getUnits()) {
            values.add(String.valueOf(unit.getCategory()));
        }
        aOut.printRecord(values);
        i++;
    }
}
Also used : ArcPosition(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.ArcPosition) Position(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.Position) IAnnotationUnit(de.tudarmstadt.ukp.dkpro.statistics.agreement.IAnnotationUnit) ArrayList(java.util.ArrayList) ICodingAnnotationItem(de.tudarmstadt.ukp.dkpro.statistics.agreement.coding.ICodingAnnotationItem)

Example 2 with IAnnotationUnit

use of de.tudarmstadt.ukp.dkpro.statistics.agreement.IAnnotationUnit in project webanno by webanno.

the class AgreementUtils method dumpAgreementConfigurationSetsWithItems.

private static void dumpAgreementConfigurationSetsWithItems(PrintStream aOut, AgreementResult aAgreement, List<ConfigurationSet> aSets) {
    int i = 0;
    for (ICodingAnnotationItem item : aAgreement.getStudy().getItems()) {
        StringBuilder sb = new StringBuilder();
        sb.append(aSets.get(i).getPosition());
        for (IAnnotationUnit unit : item.getUnits()) {
            if (sb.length() > 0) {
                sb.append(" \t");
            }
            sb.append(unit.getCategory());
        }
        aOut.println(sb);
        i++;
    }
}
Also used : IAnnotationUnit(de.tudarmstadt.ukp.dkpro.statistics.agreement.IAnnotationUnit) ICodingAnnotationItem(de.tudarmstadt.ukp.dkpro.statistics.agreement.coding.ICodingAnnotationItem)

Example 3 with IAnnotationUnit

use of de.tudarmstadt.ukp.dkpro.statistics.agreement.IAnnotationUnit in project webanno by webanno.

the class AgreementUtils method dumpStudy.

public static void dumpStudy(PrintStream aOut, ICodingAnnotationStudy aStudy) {
    try {
        aOut.printf("Category count: %d%n", aStudy.getCategoryCount());
    } catch (Throwable e) {
        aOut.printf("Category count: %s%n", ExceptionUtils.getRootCauseMessage(e));
    }
    try {
        aOut.printf("Item count: %d%n", aStudy.getItemCount());
    } catch (Throwable e) {
        aOut.printf("Item count: %s%n", ExceptionUtils.getRootCauseMessage(e));
    }
    for (ICodingAnnotationItem item : aStudy.getItems()) {
        StringBuilder sb = new StringBuilder();
        for (IAnnotationUnit unit : item.getUnits()) {
            if (sb.length() > 0) {
                sb.append(" \t");
            }
            sb.append(unit.getCategory());
        }
        aOut.println(sb);
    }
}
Also used : IAnnotationUnit(de.tudarmstadt.ukp.dkpro.statistics.agreement.IAnnotationUnit) ICodingAnnotationItem(de.tudarmstadt.ukp.dkpro.statistics.agreement.coding.ICodingAnnotationItem)

Aggregations

IAnnotationUnit (de.tudarmstadt.ukp.dkpro.statistics.agreement.IAnnotationUnit)3 ICodingAnnotationItem (de.tudarmstadt.ukp.dkpro.statistics.agreement.coding.ICodingAnnotationItem)3 ArcPosition (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.ArcPosition)1 Position (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.Position)1 ArrayList (java.util.ArrayList)1