svenwey commited on
Commit
b6570bd
·
1 Parent(s): b705ef3

bug fix (logical mistake)

Browse files
Files changed (1) hide show
  1. logmetric.py +7 -3
logmetric.py CHANGED
@@ -247,9 +247,13 @@ class LogMetric(evaluate.Metric):
247
  ref_logMessages.append(ref_split_log[i+1])
248
 
249
  # We extend the shorter list to the length of the longer one
250
- min_logentries = min(len(pred_logMessages), len(ref_logMessages))
251
- pred_logMessages += (len(pred_logMessages) - min_logentries) * [""]
252
- ref_logMessages += (len(ref_logMessages) - min_logentries) * [""]
 
 
 
 
253
 
254
 
255
  linecontent_sacrebleu, linecontentlength_difference_SMAPE = self.getLineContentScore(pred_logMessages, ref_logMessages)
 
247
  ref_logMessages.append(ref_split_log[i+1])
248
 
249
  # We extend the shorter list to the length of the longer one
250
+ max_logentries = max(len(pred_logMessages), len(ref_logMessages))
251
+
252
+ pred_logMessages += (max_logentries - len(pred_logMessages)) * [" "]
253
+ ref_logMessages += (max_logentries- len(ref_logMessages)) * [" "]
254
+
255
+ print(len(pred_logMessages), pred_logMessages)
256
+ print(len(ref_logMessages), ref_logMessages)
257
 
258
 
259
  linecontent_sacrebleu, linecontentlength_difference_SMAPE = self.getLineContentScore(pred_logMessages, ref_logMessages)