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

Function eval_where

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

Source from the content-addressed store, hash-verified

130
131
132def eval_where(pred, label):
133 pred_conds = [unit for unit in pred['where'][::2]]
134 label_conds = [unit for unit in label['where'][::2]]
135 label_wo_agg = [unit[2] for unit in label_conds]
136 pred_total = len(pred_conds)
137 label_total = len(label_conds)
138 cnt = 0
139 cnt_wo_agg = 0
140
141 for unit in pred_conds:
142 if unit in label_conds:
143 cnt += 1
144 label_conds.remove(unit)
145 if unit[2] in label_wo_agg:
146 cnt_wo_agg += 1
147 label_wo_agg.remove(unit[2])
148
149 return label_total, pred_total, cnt, cnt_wo_agg
150
151
152def eval_group(pred, label):

Callers 1

eval_partial_matchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected