Skip to content

Commit

Permalink
Fix extra space before punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
alifarrokh committed Feb 19, 2024
1 parent 14a7a71 commit 7f57835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions load_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def __init__(self, ignore_case: bool, force_4_choices: bool, ds_format: str):

def __clean_text(self, text):
"""Clean a piece of text"""
text = text.replace(',', ' , ')
text = text.replace(',', ', ')
text = re.sub(r'\?+', '?', text)
text = text.replace('\n', ' ')
text = re.sub(r'(\.\s?)+', ' . ', text)
text = re.sub(r'(\.\s?)+', '. ', text)
text = re.sub(r'\s+', ' ', text).strip()
if self.ignore_case:
text = text.lower()
Expand Down

0 comments on commit 7f57835

Please sign in to comment.