Skip to content

Commit

Permalink
fix style checking errs.
Browse files Browse the repository at this point in the history
Change-Id: I6f56dd2b99eb912c7a2a3191f5efd8139bbccd33
  • Loading branch information
liuyuuan committed Oct 27, 2017
1 parent 1ee5dbd commit 4dd772c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions utils/baseline_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
from brc_eval import compute_metrics_from_list

EMPTY = ''

YESNO_LABELS = {
'None': 0,
'Yes': 1,
'No': 2,
'Depends': 3}


def getid(query):
"""
compute id.
Expand All @@ -34,6 +36,7 @@ def getid(query):
m.update(query.encode('utf8'))
return m.hexdigest()


def build_yesno_golden(obj):
"""
Get golden reference of query_id.
Expand Down Expand Up @@ -62,6 +65,7 @@ def build_yesno_golden(obj):

return ret_list


def build_yesno_human(obj):
"""
Get human result.
Expand Down Expand Up @@ -95,6 +99,7 @@ def build_yesno_human(obj):

return no_dup_list


def build_yesno_ctrl(obj):
"""
Get control experiment result.
Expand All @@ -115,6 +120,7 @@ def build_yesno_ctrl(obj):

return ret_list


def build_yesno_random(obj):
"""
Get results of random model.
Expand All @@ -139,6 +145,7 @@ def build_yesno_random(obj):

return ret_list


def build_yesno_exp(obj):
"""
Get results of experiment.
Expand All @@ -164,6 +171,7 @@ def build_yesno_exp(obj):

return ret_list


def build_normal(obj):
"""
Normal answer result.
Expand All @@ -175,6 +183,7 @@ def build_normal(obj):
ret_list.append(result)
return ret_list


def build_normal_golden(obj):
"""
build normal golden
Expand All @@ -186,6 +195,7 @@ def build_normal_golden(obj):
ret_list.append(result)
return ret_list


def merge_dict(li_pred, li_ref):
"""
merge results.
Expand Down Expand Up @@ -214,6 +224,7 @@ def merge_one(a, b):
ref_list.append(obj_ref)
return pred_list, ref_list


def get_metrics(pred_results, ref_results):
"""
compute metric.
Expand All @@ -222,6 +233,7 @@ def get_metrics(pred_results, ref_results):
metrics = compute_metrics_from_list(pred_list, ref_list, 4)
return metrics


def main():
"""
The main logic.
Expand Down

0 comments on commit 4dd772c

Please sign in to comment.