svenwey commited on
Commit
23b4a0b
·
1 Parent(s): 37ee0fe

edge case when in getLineContentScore both args are [], sacrebleu doesn't work properly

Browse files
Files changed (1) hide show
  1. logmetric.py +3 -1
logmetric.py CHANGED
@@ -147,7 +147,9 @@ class LogMetric(evaluate.Metric):
147
 
148
  # Get differenct scores regarding the content of a log-message
149
  def getLineContentScore(self, pred_logMessages, ref_logMessages):
150
- sacrebleu_score = self.sacrebleu_metric.compute(predictions=pred_logMessages, references=ref_logMessages)["score"]/ 100.0
 
 
151
 
152
  smape_length_score = self.get_length_score(pred_logMessages, ref_logMessages)
153
 
 
147
 
148
  # Get differenct scores regarding the content of a log-message
149
  def getLineContentScore(self, pred_logMessages, ref_logMessages):
150
+ if pred_logMessages == [] and ref_logMessages == []:
151
+ pred_logMessages, ref_logMessages = [""]
152
+ sacrebleu_score = self.sacrebleu_metric.compute(predictions=pred_logMessages, references=ref_logMessages)["score"] / 100.0
153
 
154
  smape_length_score = self.get_length_score(pred_logMessages, ref_logMessages)
155