| 55 | return self.dataset["test"] |
| 56 | |
| 57 | def detokenize(self, text): |
| 58 | text = text.replace(" '", "'") |
| 59 | text = text.replace(" \n", "\n") |
| 60 | text = text.replace("\n ", "\n") |
| 61 | text = text.replace(" n't", "n't") |
| 62 | text = text.replace("`` ", '"') |
| 63 | text = text.replace("''", '"') |
| 64 | # punctuation |
| 65 | text = text.replace(" :", ":") |
| 66 | text = text.replace(" ;", ";") |
| 67 | text = text.replace(" !", "!") |
| 68 | text = text.replace(" ?", "?") |
| 69 | text = text.replace(" ,", ",") |
| 70 | text = text.replace(" .", ".") |
| 71 | return text |
| 72 | |
| 73 | def doc_to_text(self, doc): |
| 74 | passage = " ".join(doc["sentences"]) |