Skip to content

Commit

Permalink
Update evaluation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Waste-Wood committed Mar 29, 2022
1 parent e558f18 commit 13c9895
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions evaluation_metrics_causal_reasoning.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def evaluation_metrics(gold, predictions):
return accuracy



def main():
prediction_file = sys.argv[1]
gold_file = sys.argv[2]
Expand Down
6 changes: 3 additions & 3 deletions evalution_metrics_conceptual_explanation_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def evaluation_bleu(gold, predictions):


def evaluation_rouge(golds, predictions):
rougel = 0
rouge_l = 0
rouge = Rouge()

for key in predictions:
Expand All @@ -39,11 +39,11 @@ def evaluation_rouge(golds, predictions):

try:
scores = rouge.get_scores(prediction, gold)
rougel += scores[0]['rouge-l']['r']
rouge_l += scores[0]['rouge-l']['r']
except:
continue

avg_rougel = rougel / len(golds)
avg_rougel = rouge_l / len(golds)
return avg_rougel


Expand Down

0 comments on commit 13c9895

Please sign in to comment.