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

Function eval_sel

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

Source from the content-addressed store, hash-verified

110
111
112def eval_sel(pred, label):
113 pred_sel = pred['select'][1]
114 label_sel = label['select'][1]
115 label_wo_agg = [unit[1] for unit in label_sel]
116 pred_total = len(pred_sel)
117 label_total = len(label_sel)
118 cnt = 0
119 cnt_wo_agg = 0
120
121 for unit in pred_sel:
122 if unit in label_sel:
123 cnt += 1
124 label_sel.remove(unit)
125 if unit[1] in label_wo_agg:
126 cnt_wo_agg += 1
127 label_wo_agg.remove(unit[1])
128
129 return label_total, pred_total, cnt, cnt_wo_agg
130
131
132def eval_where(pred, label):

Callers 1

eval_partial_matchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected