BayesTensor's picture
Upload folder using huggingface_hub
9d5b280 verified
raw
history blame contribute delete
510 Bytes
lev_answer_mapping = {"true": "ู†ุนู…", "false": "ู„ุง", True: "ู†ุนู…", False: "ู„ุง"}
def process_docs(dataset):
def remove_question_mark(text):
text = text.strip()
if text.endswith("?") or text.endswith("ุŸ"):
text = text[:-1]
text = text.strip()
return text
def _helper(doc):
doc["question"] = remove_question_mark(doc["question"])
doc["target"] = lev_answer_mapping[doc["answer"]]
return doc
return dataset.map(_helper)