Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/finbert_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,11 +842,11 @@ def predict(self, model, q_text, cands):
pred = pred.detach().cpu().numpy()
# Append relevant scores to list (where label = 1)
scores.append(pred[:,1][0])
# Get the indices of the sorted similarity scores
sorted_index = np.argsort(scores)[::-1]
# Get the list of docid from the sorted indices
ranked_ans = list(cands_id[sorted_index])
sorted_scores = list(np.around(sorted(scores, reverse=True),decimals=3))
# Get the indices of the sorted similarity scores
sorted_index = np.argsort(scores)[::-1]
# Get the list of docid from the sorted indices
ranked_ans = list(cands_id[sorted_index])
sorted_scores = list(np.around(sorted(scores, reverse=True),decimals=3))

return ranked_ans, sorted_scores

Expand Down