(cls, text)
| 61 | |
| 62 | @classmethod |
| 63 | def preprocess(cls, text): |
| 64 | text = text.strip() |
| 65 | # NOTE: Brackets are artifacts of the WikiHow dataset portion of HellaSwag. |
| 66 | text = text.replace(" [title]", ". ") |
| 67 | text = re.sub("\\[.*?\\]", "", text) |
| 68 | text = text.replace(" ", " ") |
| 69 | return text |
| 70 | |
| 71 | def doc_to_text(self, doc): |
| 72 | return doc["query"] |