MCPcopy Index your code
hub / github.com/RingBDStack/GDAP / count_instance

Method count_instance

evaluation.py:165–181  ·  view source on GitHub ↗
(self, gold_list, pred_list, verbose=False, text=None)

Source from the content-addressed store, hash-verified

163 }
164
165 def count_instance(self, gold_list, pred_list, verbose=False, text=None):
166 if verbose:
167 print("Gold:", gold_list)
168 print("Pred:", pred_list)
169 self.gold_num += len(gold_list)
170 self.pred_num += len(pred_list)
171
172 dup_gold_list = deepcopy(gold_list)
173 for pred in pred_list:
174 if pred in dup_gold_list:
175 self.tp += 1
176 dup_gold_list.remove(pred)
177 else:
178 print("text: ", text)
179 print("gold_list: ", gold_list)
180 print("no tp pred:", pred)
181 pass
182
183def main():
184 parser = argparse.ArgumentParser()

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected