public void testAccuracy() { Parser parser = new ChildrenFromVectors(new CoNLL2000Parser(labeledData)); int numSeen = 0; int numEqual = 0; for (Token w = (Token) parser.next(); w != null; w = (Token) parser.next()) { String prediction = tagger.discreteValue(w); String raw = w.toString(); String actualChunk = raw.substring(raw.indexOf('(') + 1, raw.indexOf(' ')); if (prediction.equals(actualChunk)) { numEqual++; } numSeen++; } logger.info("Total accuracy over " + numSeen + " items: " + String.format("%.2f", 100.0 * (double) numEqual / (double) numSeen) + "%"); }
public void testAccuracy() { Parser parser = new ChildrenFromVectors(new CoNLL2000Parser(labeledData)); int numSeen = 0; int numEqual = 0; for (Token w = (Token) parser.next(); w != null; w = (Token) parser.next()) { String prediction = tagger.discreteValue(w); String raw = w.toString(); String actualChunk = raw.substring(raw.indexOf('(') + 1, raw.indexOf(' ')); if (prediction.equals(actualChunk)) { numEqual++; } numSeen++; } logger.info("Total accuracy over " + numSeen + " items: " + String.format("%.2f", 100.0 * (double) numEqual / (double) numSeen) + "%"); }
Span current = tags.get(tcounter); tagger.discreteValue(lbjtoken); logger.debug("{} {}", lbjtoken.toString(), lbjtoken.type); if (lbjtoken.type.charAt(0) == 'I') { if (!clabel.equals(lbjtoken.type.substring(2))) {
Constituent current = tags.get(tcounter); tagger.discreteValue(lbjtoken); logger.debug("{} {}", lbjtoken.toString(), (null == lbjtoken.type) ? "NULL" : lbjtoken.type);
Constituent current = tags.get(tcounter); tagger.discreteValue(lbjtoken); logger.debug("{} {}", lbjtoken.toString(), (null == lbjtoken.type) ? "NULL" : lbjtoken.type);
Constituent current = tags.get(tcounter); tagger.discreteValue(lbjtoken); logger.debug("{} {}", lbjtoken.toString(), (null == lbjtoken.type) ? "NULL" : lbjtoken.type);
Constituent current = tags.get(tcounter); tagger.discreteValue(lbjtoken); logger.debug("{} {}", lbjtoken.toString(), (null == lbjtoken.type) ? "NULL" : lbjtoken.type);