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