(expr)
| 245 | # print(ast.logical_form_with_type()) |
| 246 | |
| 247 | def simplify_textual_form(expr): |
| 248 | toks = expr.split(' ') |
| 249 | |
| 250 | norm_toks = [] |
| 251 | for t in toks: |
| 252 | # normalize entity |
| 253 | if t.startswith('m.'): |
| 254 | pass |
| 255 | elif 'XMLSchema' in t: |
| 256 | pass |
| 257 | elif '.' in t: |
| 258 | meta_relations = t = t.split('.') |
| 259 | t = meta_relations[-1] |
| 260 | if '.' in t: |
| 261 | t = t.replace('.', ' , ') |
| 262 | if '_' in t: |
| 263 | t = t.replace('.', ' , ') |
| 264 | # normalize type |
| 265 | norm_toks.append(t) |
| 266 | return ' '.join(norm_toks) |
| 267 | |
| 268 | def test_text_converter(): |
| 269 | # dataset = load_json('outputs/grailqa_v1.0_dev.json') |
no outgoing calls