garrethlee
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -22,3 +22,41 @@ configs:
|
|
22 |
- split: test
|
23 |
path: data/test-*
|
24 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
- split: test
|
23 |
path: data/test-*
|
24 |
---
|
25 |
+
|
26 |
+
Adapted from https://huggingface.co/datasets/mwpt5/MAWPS
|
27 |
+
|
28 |
+
Processed with the following code:
|
29 |
+
|
30 |
+
```
|
31 |
+
def process_row(row):
|
32 |
+
# Create placeholder-to-actual mapping
|
33 |
+
placeholder_map = [(f"N_{i:02}", actual) for i, actual in enumerate(row['Numbers'].split())]
|
34 |
+
|
35 |
+
try:
|
36 |
+
# Process placeholders and replacements
|
37 |
+
for placeholder, replacement in placeholder_map:
|
38 |
+
replacement_value = float(replacement)
|
39 |
+
# Convert to integer if it is a whole number, otherwise round to 2 decimal places
|
40 |
+
replacement = str(int(replacement_value)) if replacement_value.is_integer() else str(round(replacement_value, 2))
|
41 |
+
|
42 |
+
# Update Question and Equation with the new replacement value
|
43 |
+
row['Question'] = row['Question'].strip().replace(placeholder, replacement)
|
44 |
+
row['Equation'] = row['Equation'].strip().replace(placeholder, replacement)
|
45 |
+
|
46 |
+
# Process Answer
|
47 |
+
answer_value = float(row['Answer'])
|
48 |
+
row['Answer'] = str(int(answer_value)) if answer_value.is_integer() else str(round(answer_value, 2))
|
49 |
+
|
50 |
+
# Format the final answer string
|
51 |
+
row['Answer'] = f"{row['Equation']} = {row['Answer']} #### {row['Answer']}"
|
52 |
+
|
53 |
+
except ValueError as e:
|
54 |
+
print(f"ValueError: {e}")
|
55 |
+
except Exception as e:
|
56 |
+
print(f"Unexpected error: {e}")
|
57 |
+
|
58 |
+
return row
|
59 |
+
|
60 |
+
```
|
61 |
+
|
62 |
+
To format the answers, I used a similar formatting style to GSM8K's answers, which allows for easy parsing for evaluation.
|