return
// Turn CandidateSet into set of tuples
logger.info("Preparing candidates...")
pb = ProgressBar(len(candidates))
entities = set()
for i, c in enumerate(candidates):
pb.bar(i)
part = c[0].span.get_span()
doc = c[0].span.sentence.document.name.upper()
if attribute:
val = c[1].span.get_span()
for p in get_implied_parts(part, doc, parts_by_doc):
if attribute:
entities.add((doc, p, val))
else:
entities.add((doc, p))
pb.close()
(TP_set, FP_set, FN_set) = entity_confusion_matrix(entities, gold_set)
TP = len(TP_set)
FP = len(FP_set)
After Change
// Turn CandidateSet into set of tuples
logger.info("Preparing candidates...")
entities = set()
for i, c in enumerate(tqdm(candidates)):
part = c[0].span.get_span()
doc = c[0].span.sentence.document.name.upper()
if attribute: