Skip to content

Commit d164644

Browse files
author
Marcin Kardas
committed
Select best proposals from top-k
1 parent cdcd36d commit d164644

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sota_extractor2/models/linking/linker.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ def __call__(self, paper, tables, topk=1):
2121
proposals = proposals.set_index('cell_ext_id')
2222
best = proposals
2323
else:
24-
best = proposals.groupby('cell_ext_id').head(1).set_index('cell_ext_id')
24+
best = self.get_best_proposals(proposals)
2525

2626
pipeline_logger(f"{Linker.step}::linked", paper=paper, tables=tables, proposals=best)
2727
return proposals
28+
29+
def get_best_proposals(self, proposals):
30+
return proposals.groupby('cell_ext_id').head(1).set_index('cell_ext_id')

0 commit comments

Comments
 (0)