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)
| 100 | return ll_true, ll_neither, ll_false |
| 101 | |
| 102 | def process_results(self, doc, results): |
| 103 | """Take a single document and the LM results and evaluates, returning a |
| 104 | dict where keys are the names of submetrics and values are the values of |
| 105 | the metric for that one document |
| 106 | |
| 107 | :param doc: |
| 108 | The document as returned from training_docs, validation_docs, or test_docs. |
| 109 | :param results: |
| 110 | The results of the requests created in construct_requests. |
| 111 | """ |
| 112 | gold = doc["label"] |
| 113 | pred = np.argmax(results) |
| 114 | return {"acc": pred == gold} |
| 115 | |
| 116 | def aggregation(self): |
| 117 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected