Remove new lines and multiple spaces and adjust end of sentence dot.
(text)
| 30 | |
| 31 | |
| 32 | def clean_text(text): |
| 33 | """Remove new lines and multiple spaces and adjust end of sentence dot.""" |
| 34 | |
| 35 | text = text.replace("\n", " ") |
| 36 | text = re.sub(r'\s+', ' ', text) |
| 37 | for _ in range(3): |
| 38 | text = text.replace(' . ', '. ') |
| 39 | |
| 40 | return text |
| 41 | |
| 42 | |
| 43 | class InputExample(object): |