Search in sources :

Example 1 with IAnnotationUnit

use of org.dkpro.statistics.agreement.IAnnotationUnit in project webanno by webanno.

the class AgreementUtils method configurationSetsWithItemsToCsv.

private static void configurationSetsWithItemsToCsv(CSVPrinter aOut, AgreementResult<ICodingAnnotationStudy> 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 : Position(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.api.Position) RelationPosition(de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.relation.RelationPosition) IAnnotationUnit(org.dkpro.statistics.agreement.IAnnotationUnit) ArrayList(java.util.ArrayList) ICodingAnnotationItem(org.dkpro.statistics.agreement.coding.ICodingAnnotationItem)

Example 2 with IAnnotationUnit

use of org.dkpro.statistics.agreement.IAnnotationUnit in project webanno by webanno.

the class AgreementUtils method dumpAgreementConfigurationSetsWithItems.

private static void dumpAgreementConfigurationSetsWithItems(PrintStream aOut, AgreementResult<ICodingAnnotationStudy> 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(org.dkpro.statistics.agreement.IAnnotationUnit) ICodingAnnotationItem(org.dkpro.statistics.agreement.coding.ICodingAnnotationItem)

Aggregations

IAnnotationUnit (org.dkpro.statistics.agreement.IAnnotationUnit)2 ICodingAnnotationItem (org.dkpro.statistics.agreement.coding.ICodingAnnotationItem)2 Position (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.api.Position)1 RelationPosition (de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.relation.RelationPosition)1 ArrayList (java.util.ArrayList)1