remove sacrebleu from parameters of _compute
Browse files- logmetric.py +3 -1
logmetric.py
CHANGED
@@ -69,6 +69,8 @@ class LogMetric(evaluate.Metric):
|
|
69 |
# Constant regex to get timestrings
|
70 |
timestamp_regex = r'^\s*(\d{4}[-/.]\d{2}[-/.]\d{2}(?:[ T]\d{2}[:]\d{2}(?:[:]\d{2}(?:[.,]\d+)?)?(?:Z|[+-]\d{2}[:]\d{2})?)?)\s*'
|
71 |
timestamp_pattern = re.compile(timestamp_regex, re.MULTILINE)
|
|
|
|
|
72 |
|
73 |
def _info(self):
|
74 |
# TODO: Specifies the evaluate.EvaluationModuleInfo object
|
@@ -187,7 +189,7 @@ class LogMetric(evaluate.Metric):
|
|
187 |
# Correct amt of timestrings, monotonically increasing, consistent + (by dateutil.parser) parsable format
|
188 |
return 0.2 * monotonicallyIncreasingScore + 0.1 * matchesPatternScore + 0.7 * logmessage_aggregated_score
|
189 |
|
190 |
-
def _compute(self, predictions, references
|
191 |
"""Returns the scores"""
|
192 |
|
193 |
# TODO: get separate log entries (split before timestamps), replace timestamps with token and compare the log entry with BLEU
|
|
|
69 |
# Constant regex to get timestrings
|
70 |
timestamp_regex = r'^\s*(\d{4}[-/.]\d{2}[-/.]\d{2}(?:[ T]\d{2}[:]\d{2}(?:[:]\d{2}(?:[.,]\d+)?)?(?:Z|[+-]\d{2}[:]\d{2})?)?)\s*'
|
71 |
timestamp_pattern = re.compile(timestamp_regex, re.MULTILINE)
|
72 |
+
sacrebleu = evaluate.load("sacrebleu")
|
73 |
+
|
74 |
|
75 |
def _info(self):
|
76 |
# TODO: Specifies the evaluate.EvaluationModuleInfo object
|
|
|
189 |
# Correct amt of timestrings, monotonically increasing, consistent + (by dateutil.parser) parsable format
|
190 |
return 0.2 * monotonicallyIncreasingScore + 0.1 * matchesPatternScore + 0.7 * logmessage_aggregated_score
|
191 |
|
192 |
+
def _compute(self, predictions, references):
|
193 |
"""Returns the scores"""
|
194 |
|
195 |
# TODO: get separate log entries (split before timestamps), replace timestamps with token and compare the log entry with BLEU
|