MCPcopy Create free account
hub / github.com/awslabs/gap-text2sql / eval_group

Function eval_group

rat-sql-gap/seq2struct/datasets/spider_lib/evaluation.py:152–164  ·  view source on GitHub ↗
(pred, label)

Source from the content-addressed store, hash-verified

150
151
152def eval_group(pred, label):
153 pred_cols = [unit[1] for unit in pred['groupBy']]
154 label_cols = [unit[1] for unit in label['groupBy']]
155 pred_total = len(pred_cols)
156 label_total = len(label_cols)
157 cnt = 0
158 pred_cols = [pred.split(".")[1] if "." in pred else pred for pred in pred_cols]
159 label_cols = [label.split(".")[1] if "." in label else label for label in label_cols]
160 for col in pred_cols:
161 if col in label_cols:
162 cnt += 1
163 label_cols.remove(col)
164 return label_total, pred_total, cnt
165
166
167def eval_having(pred, label):

Callers 1

eval_partial_matchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected