Take a single document and the LM results and evaluates, returning a dict where keys are the names of submetrics and values are the values of the metric for that one document :param doc: The document as returned from training_docs, validation_docs, or test_docs.
(self, doc, results)
| 70 | return rf.greedy_until(ctx, ["\n"]) |
| 71 | |
| 72 | def process_results(self, doc, results): |
| 73 | """Take a single document and the LM results and evaluates, returning a |
| 74 | dict where keys are the names of submetrics and values are the values of |
| 75 | the metric for that one document |
| 76 | |
| 77 | :param doc: |
| 78 | The document as returned from training_docs, validation_docs, or test_docs. |
| 79 | :param results: |
| 80 | The results of the requests created in construct_requests. |
| 81 | """ |
| 82 | gold = doc["answer"] |
| 83 | pred = gold.strip() == results[0].strip() |
| 84 | return {"em": pred} |
| 85 | |
| 86 | def aggregation(self): |
| 87 | return { |
nothing calls this directly
no outgoing calls
no test coverage detected