handle cases where there are mulitple correct refs and use the best score
Browse files- nl2bash_m.py +2 -2
nl2bash_m.py
CHANGED
@@ -134,8 +134,8 @@ class nl2bash_m(evaluate.Metric):
|
|
134 |
|
135 |
# Calculate scores
|
136 |
cmd_score = cmd_weight * cmd_corr
|
137 |
-
opt_score = opt_weight * get_score(pred_option, ref_option)
|
138 |
-
arg_score = arg_weight * get_score(pred_args, ref_args)
|
139 |
|
140 |
score = cmd_score + opt_score + arg_score
|
141 |
best_score = max(best_score, score)
|
|
|
134 |
|
135 |
# Calculate scores
|
136 |
cmd_score = cmd_weight * cmd_corr
|
137 |
+
opt_score = opt_weight * self.get_score(pred_option, ref_option)
|
138 |
+
arg_score = arg_weight * self.get_score(pred_args, ref_args)
|
139 |
|
140 |
score = cmd_score + opt_score + arg_score
|
141 |
best_score = max(best_score, score)
|