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++;
}
}
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++;
}
}
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);
}
}
Aggregations