Commit 66736bc1 authored by Baber's avatar Baber
Browse files

fixup

parent 616a5403
...@@ -1282,7 +1282,7 @@ class ConfigurableTask(Task): ...@@ -1282,7 +1282,7 @@ class ConfigurableTask(Task):
return self.config.process_results(doc, results) return self.config.process_results(doc, results)
result_dict = {} result_dict = {}
use_metric = list(m.metric_name for m in self.metric_list) use_metric = list(m.metric_name for m in self.config._metric_list)
if self.OUTPUT_TYPE == "loglikelihood": if self.OUTPUT_TYPE == "loglikelihood":
results = results[0] results = results[0]
ll, is_greedy = results ll, is_greedy = results
...@@ -1408,7 +1408,7 @@ class ConfigurableTask(Task): ...@@ -1408,7 +1408,7 @@ class ConfigurableTask(Task):
# cast gold to the same type as result # cast gold to the same type as result
gold = type(result)(gold) gold = type(result)(gold)
for metric in self.metric_list: for metric in self.config._metric_list:
if self.multiple_target: if self.multiple_target:
# in the case where we have multiple targets, # in the case where we have multiple targets,
# return true if any are true # return true if any are true
...@@ -1471,10 +1471,10 @@ class ConfigurableTask(Task): ...@@ -1471,10 +1471,10 @@ class ConfigurableTask(Task):
return result_dict return result_dict
def aggregation(self) -> dict: def aggregation(self) -> dict:
return {k.name: k.aggregation_fn for k in self.metric_list} return {k.name: k.aggregation_fn for k in self.config._metric_list}
def higher_is_better(self) -> dict: def higher_is_better(self) -> dict:
return {k.name: k.higher_is_better for k in self.metric_list} return {k.name: k.higher_is_better for k in self.config._metric_list}
def get_config(self, key: str) -> Any: def get_config(self, key: str) -> Any:
return getattr(self._config, key, None) return getattr(self._config, key, None)
......
...@@ -310,7 +310,7 @@ class TaskConfig(dict): ...@@ -310,7 +310,7 @@ class TaskConfig(dict):
) )
for m in metrics: for m in metrics:
if m not in self._metric_list: if m not in self._metric_list:
self._metric_list.extend(m) self._metric_list.append(m)
return metrics return metrics
@property @property
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment