google-deepmind / mathematics_dataset

This dataset code generates mathematical question and answer pairs, from a range of question types at roughly school-level difficulty.
Apache License 2.0
1.8k stars 249 forks source link

Generate mathematical statements rather than questions #8

Closed TianrenWang closed 5 years ago

TianrenWang commented 5 years ago

Is there an easy way to modify the code in this repo so that you can generate statements rather than questions?

For example, instead of generating a sample with Question "What is 4 + 4?" and Answer "8". Is it possible to generate the statement "4 + 4 = 8"?

davidsaxton commented 5 years ago

The code is pretty easy to modify assuming you know python. E.g., to change the addition question, you could modify some of the templates here: https://github.com/deepmind/mathematics_dataset/blob/master/mathematics_dataset/modules/arithmetic.py#L141 (maybe putting what you want just as a question template), then modify the generation to only print out the question (see e.g., https://github.com/deepmind/mathematics_dataset/blob/master/mathematics_dataset/generate.py)