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
(self, doc, ctx)
| 73 | return ret |
| 74 | |
| 75 | def construct_requests(self, doc, ctx): |
| 76 | """Uses RequestFactory to construct Requests and returns an iterable of |
| 77 | Requests which will be sent to the LM. |
| 78 | :param doc: |
| 79 | The document as returned from training_docs, validation_docs, or test_docs. |
| 80 | :param ctx: str |
| 81 | The context string, generated by fewshot_context. This includes the natural |
| 82 | language description, as well as the few shot examples, and the question |
| 83 | part of the document for `doc`. |
| 84 | """ |
| 85 | continuation = rf.greedy_until(ctx, {"until": ["\n", ".", ","]}) |
| 86 | return continuation |
| 87 | |
| 88 | def process_results(self, doc, results): |
| 89 | continuation = results[0].strip().lower().translate(str.maketrans('', '', string.punctuation)) |
nothing calls this directly
no test coverage detected