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)
| 110 | return ll_yes, ll_no |
| 111 | |
| 112 | def process_results(self, doc, results): |
| 113 | """Take a single document and the LM results and evaluates, returning a |
| 114 | dict where keys are the names of submetrics and values are the values of |
| 115 | the metric for that one document |
| 116 | |
| 117 | :param doc: |
| 118 | The document as returned from training_docs, validation_docs, or test_docs. |
| 119 | :param results: |
| 120 | The results of the requests created in construct_requests. |
| 121 | """ |
| 122 | ll_yes, ll_no = results |
| 123 | |
| 124 | pred = ll_yes > ll_no |
| 125 | |
| 126 | true_label = doc["label"] |
| 127 | |
| 128 | return { |
| 129 | "acc": pred == true_label, |
| 130 | } |
| 131 | |
| 132 | def aggregation(self): |
| 133 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected