edge case when in getLineContentScore both args are [], sacrebleu doesn't work properly
Browse files- 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 |
-
|
|
|
|
|
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 |
|