Skip to content
Implementation of NAACL 2019 paper "Semantically-Aligned Equation Generation for Solving and Reasoning Math Word Problem"
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

End-to-End Math Solver

The implementation of the NAACL 2019 paper Semantically-Aligned Equation Generation for Solving and Reasoning Math Word Problems.


  1. Download required files:
  2. Preprocess dataset:
cd src/
mkdir ../data/
python ~/storage/MWP/data/math23k_fix.json ~/storage/cc.zh.300.vec ../data/train_valid.pkl --valid_ratio 0 --char_based

Note that the warning is not unexpected, because some of the problems use operator out of +, -, *, /. The purpose of the flags are as follow:

  • --valid-ratio 0: Set the ratio the validation dataset should take. It should be set to 0 when running 5-fold cross validation.
  • --char_based: Specify if you want to tokenize the problem text into characters rather into words.
  1. Start 5-fold cross-validation by
mkdir ../models
python ../data/train_valid.pkl ../models/model.pkl --five_fold
You can’t perform that action at this time.