public void link(String id1, String id2, double confidence) throws IOException { boolean correct = true; // does this provide new information, or do we know it already? Link inferredlink = null; if (linkdb != null) inferredlink = linkdb.inferLink(id1, id2); // record it if (console != null) { if (inferredlink == null) { correct = console.yesorno(); confidence = 1.0; // the user told us, which is as certain as it gets } else { correct = inferredlink.getKind() == LinkKind.SAME; confidence = inferredlink.getConfidence(); } } // note that we also write inferred links, because the test file // listener does not do inference writer.write(id1, id2, correct, confidence); out.flush(); // make sure we preserve the data if (linkdb != null && inferredlink == null) { Link link = new Link(id1, id2, LinkStatus.ASSERTED, correct ? LinkKind.SAME : LinkKind.DIFFERENT, 1.0); linkdb.assertLink(link); } }
public synchronized void matches(Record r1, Record r2, double confidence) { String id1 = getid(r1); String id2 = getid(r2); Link link = golddb.inferLink(id1, id2); if (link == null) { unknown++; // we don't know if this one is right or not if (debug && !showmatches) PrintMatchListener.show(r1, r2, confidence, "\nNOT IN TEST FILE", props, pretty); } else if (link.getKind() == LinkKind.SAME) // no counting now; we do that when we're done dukedb.assertLink(new Link(id1, id2, LinkStatus.INFERRED, LinkKind.SAME, confidence)); else if (link.getKind() == LinkKind.DIFFERENT) { wrongfound++; // we found it, but it's not right if (debug && !showmatches) PrintMatchListener.show(r1, r2, confidence, "\nINCORRECT", props, pretty); } else { unknown++; // we don't know if this one is right or not if (debug && !showmatches) PrintMatchListener.show(r1, r2, confidence, "\nUNKNOWN LINK TYPE", props, pretty); } }
public void link(String id1, String id2) throws IOException { boolean correct = true; // does this provide new information, or do we know it already? Link inferredlink = null; if (linkdb != null) inferredlink = linkdb.inferLink(id1, id2); // record it if (console != null) { if (inferredlink == null) correct = console.yesorno(); else correct = inferredlink.getKind() == LinkKind.SAME; } // note that we also write inferred links, because the test file // listener does not do inference writer.write(id1, id2, correct, 1.0); out.flush(); // make sure we preserve the data if (linkdb != null && inferredlink == null) { Link link = new Link(id1, id2, LinkStatus.ASSERTED, correct ? LinkKind.SAME : LinkKind.DIFFERENT, 1.0); linkdb.assertLink(link); } }
public synchronized void matches(Record r1, Record r2, double confidence) { String id1 = getid(r1); String id2 = getid(r2); Link link = golddb.inferLink(id1, id2); if (link == null) { unknown++; // we don't know if this one is right or not if (debug && !showmatches) PrintMatchListener.show(r1, r2, confidence, "\nNOT IN TEST FILE", props, pretty); } else if (link.getKind() == LinkKind.SAME) // no counting now; we do that when we're done dukedb.assertLink(new Link(id1, id2, LinkStatus.INFERRED, LinkKind.SAME, confidence)); else if (link.getKind() == LinkKind.DIFFERENT) { wrongfound++; // we found it, but it's not right if (debug && !showmatches) PrintMatchListener.show(r1, r2, confidence, "\nINCORRECT", props, pretty); } }