(self)
| 26 | return False |
| 27 | |
| 28 | def validation_docs(self): |
| 29 | if 'validation' in self.dataset: |
| 30 | dataset = self.dataset["validation"] |
| 31 | |
| 32 | prompts = [] |
| 33 | for doc in dataset: |
| 34 | text = doc['text'] |
| 35 | doc["text"], prompt = doc["text"].split("Summary of information above...") |
| 36 | prompt = f"Summary of information above...{prompt}" |
| 37 | prompts.append(prompt) |
| 38 | |
| 39 | # add prompt to dataset |
| 40 | new_dataset = [] |
| 41 | for doc, prompt in zip(dataset, prompts): |
| 42 | doc["prompt"] = prompt |
| 43 | new_dataset.append(doc) |
| 44 | |
| 45 | # create dataset |
| 46 | dataset = datasets.Dataset.from_list(new_dataset) |
| 47 | self.dataset = dataset |
| 48 | return dataset |
| 49 | else: |
| 50 | return self.dataset |
| 51 | |
| 52 | def doc_to_text(self, doc): |
| 53 | while doc["text"].find("Summary of information above...")>=0: |
nothing calls this directly
no outgoing calls
no test coverage detected