"tools/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "d9fe1c6cc0801b0cefdf370798026d1a9d49d892"
Commit 052c7bde authored by JessicaOjo's avatar JessicaOjo
Browse files

remove squad metric

parent fef54568
...@@ -58,20 +58,6 @@ def f1_score(items): ...@@ -58,20 +58,6 @@ def f1_score(items):
return np.max(fscore) return np.max(fscore)
@register_aggregation("squad_f1")
def squad_f1_score(items):
gold_squad, pred_squad = [], []
for index, (ref, pred) in enumerate(items):
pred_dict = {'prediction_text': str(pred), 'id': str(index)}
ref_dict = {'answers': {'answer_start': [0], 'text': str(ref)}, 'id': str(index)}
gold_squad.append(ref_dict)
pred_squad.append(pred_dict)
squad_metric = hf_evaluate.load("squad")
results_squad = squad_metric.compute(predictions=pred_squad, references=gold_squad)
return results_squad['f1']
@register_aggregation("matthews_corrcoef") @register_aggregation("matthews_corrcoef")
def matthews_corrcoef(items): def matthews_corrcoef(items):
unzipped_list = list(zip(*items)) unzipped_list = list(zip(*items))
...@@ -192,16 +178,6 @@ def exact_match_fn(**kwargs): ...@@ -192,16 +178,6 @@ def exact_match_fn(**kwargs):
return exact_match.compute(**kwargs) return exact_match.compute(**kwargs)
@register_metric(
metric="squad",
higher_is_better=True,
output_type="generate_until",
aggregation="squad_f1"
)
def squad_fn(items):
return items
@register_metric( @register_metric(
metric="perplexity", metric="perplexity",
higher_is_better=False, higher_is_better=False,
......
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