[Fix] the issue where scores are negative in the Lawbench dataset evaluation(#1402) (#1403)

This commit is contained in:
yaoyingyy 2024-08-08 16:08:26 +08:00 committed by GitHub
parent 818d72a650
commit decb621ff6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,6 +44,9 @@ def compute_ljp_imprison(data_dict):
else:
score_list.append(math.log(216))
if abstentions == len(score_list):
log_distance = 0
else:
# compute the average of score_list (log distance)
log_distance = sum(score_list) / len(score_list)
# normalize the score to between 0 and 1