--- license: mit --- # GSM8K training set The original answer is "\n#### Value" and now is "\n#### Value\nThe answer is: Value", which is consistent with the answer format with "meta-math/MetaMathQA". # Dataset modification codes ```python # coding=utf-8 import jsonlines from datasets import load_dataset, Features, Value # Retrieve the path of training and testing databases context_feat = Features({"question": Value(dtype='string', id=None), "answer": Value(dtype='string', id=None)}) train_set = load_dataset('json', data_files='train.jsonl', split='train', features=context_feat) data = [] for example in train_set: # Get the label answer number = example['answer'].split('#### ')[1] number = int(number.replace(',', '')) # Append the "\nThe answer is: " and numerical answer append = "\nThe answer is: " + str(number) answer = example['answer'] + append # Get the question and make the new question-answer pair question = example['question'] data.append({"question": question, "answer": answer}) # Save the modified data to a "jsonl" file output_file = 'gsm8k_train.jsonl' with jsonlines.open(output_file, 'w') as writer: writer.write_all(data) print(f"Modified data saved to {output_file}") ```