(text)
| 25 | |
| 26 | |
| 27 | def preprocess(text): |
| 28 | text = text.strip() |
| 29 | # NOTE: Brackets are artifacts of the WikiHow dataset portion of HellaSwag. |
| 30 | text = text.replace(" [title]", ". ") |
| 31 | text = re.sub("\\[.*?\\]", "", text) |
| 32 | text = text.replace(" ", " ") |
| 33 | return text |
| 34 | |
| 35 | |
| 36 | if __name__ == '__main__': |