(obj: dict, dataset: str)
| 320 | |
| 321 | # utilization |
| 322 | def contexts(obj: dict, dataset: str): |
| 323 | if dataset == "hotpotqa": |
| 324 | context = [] |
| 325 | for i in range(len(obj["context"]["sentences"])): |
| 326 | context.append(" ".join(obj["context"]["sentences"][i])) |
| 327 | return context |
| 328 | # return obj["context"] |
| 329 | elif dataset == "longbench": |
| 330 | return obj["context"] |
| 331 | else: |
| 332 | raise ValueError("Unknown dataset format: neither 'context' nor 'paragraphs' field found") |
| 333 | |
| 334 | def check(name: str, result: dict, *args): |
| 335 | if name == "cot": |
no outgoing calls
no test coverage detected