Commit 6b6303d4 authored by Leo Gao's avatar Leo Gao
Browse files

Stable file order and don't lower

parent 69c83456
...@@ -55,7 +55,7 @@ class MuTualBase(Task): ...@@ -55,7 +55,7 @@ class MuTualBase(Task):
return False return False
def _load_docs(self, path): def _load_docs(self, path):
for file in path.iterdir(): for file in sorted(path.iterdir()):
if file.suffix != ".txt": if file.suffix != ".txt":
continue continue
with open(file, 'r', encoding='utf-8') as f: with open(file, 'r', encoding='utf-8') as f:
...@@ -100,7 +100,7 @@ class MuTualBase(Task): ...@@ -100,7 +100,7 @@ class MuTualBase(Task):
text = text.replace(" ?", "?") text = text.replace(" ?", "?")
text = text.replace(" ,", ",") text = text.replace(" ,", ",")
text = text.replace(" .", ".") text = text.replace(" .", ".")
return text.lower() return text
def process_results(self, doc, results): def process_results(self, doc, results):
gold = self.CHOICES.index(doc["answers"]) gold = self.CHOICES.index(doc["answers"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment