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