Uses RequestFactory to construct Requests and returns an iterable of Requests which will be sent to the LM. :param doc: The document as returned from training_docs, validation_docs, or test_docs. :param ctx: str The context string, generated by fewsho
(self, doc, ctx)
| 124 | return " " + ", ".join(doc["answers"][0]) |
| 125 | |
| 126 | def construct_requests(self, doc, ctx): |
| 127 | """Uses RequestFactory to construct Requests and returns an iterable of |
| 128 | Requests which will be sent to the LM. |
| 129 | |
| 130 | :param doc: |
| 131 | The document as returned from training_docs, validation_docs, or test_docs. |
| 132 | :param ctx: str |
| 133 | The context string, generated by fewshot_context. This includes the natural |
| 134 | language description, as well as the few shot examples, and the question |
| 135 | part of the document for `doc`. |
| 136 | """ |
| 137 | conts = [rf.greedy_until(ctx, {"until": ["."]})] |
| 138 | return conts |
| 139 | |
| 140 | def process_results(self, doc, results): |
| 141 | """Take a single document and the LM results and evaluates, returning a |
nothing calls this directly
no test coverage detected