MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / _extract

Function _extract

NLP/Text2SQL-BASELINE/text2sql/utils/dusql_evaluation.py:1109–1117  ·  view source on GitHub ↗

extract condition and/or

(conds)

Source from the content-addressed store, hash-verified

1107 Returns:
1108 """
1109 def _extract(conds):
1110 """extract condition and/or"""
1111 op_set = set()
1112 for i in range(1, len(conds) - 1, 2):
1113 left = conds[i - 1][:3]
1114 right = conds[i + 1][:3]
1115 left, right = list(sorted([left, right]))
1116 op_set.add(f'{left}{conds[i].lower()}{right}')
1117 return op_set
1118
1119 # eval where and/or
1120 pred_op_set = _extract(pred['where'])

Callers 1

eval_and_orFunction · 0.70

Calls 1

addMethod · 0.45

Tested by

no test coverage detected