This is the offcial repo for the paper "Non-Autoregressive Math Word Problem Solver with Unified Tree Structure".
requirements.txt
in each dictionary, run pip install -r requirements.txt
to get environment ready.Before you use the code in Math23K
dictionary, please download the missing train dataset from this link and put it in ./Math23K/datasets/
.
To train our model on Math23K, run:
python ./Math23K/main.py --mode train
To train our model on MAWPS, run:
python ./MAWPS/main_mawps.py
If you want to load the check points, please make sure you have downloaded the required files:
Please put the check point files(Math23K and MAWPS) in ./Math23K/check_points/
and ./MAWPS/check_points/
.
To use the check points and test the model on Math23K, run:
python ./Math23K/main.py --mode test
To use the check points and test the model on MAWPS, run:
python ./MAWPS/test_mawps.py
MTree Acc is proposed to solve the problem of mathematical expression variants and alleviate the drawback that Expression Acc underestimates the performance of MWP solvers. MTree IoU is proposed to evaluate the partial correctness of the prediction expression obtained by MWP solvers.
In ./Evaluation/
we provide a tool to evaluate MTree Acc and MTree IoU. You just need to convert the prediction from your model and groundtruth into the form shown in ./Evaluation/examples.json
, then run:
python ./Evaluation/evaluate.py
# If this repo is helpful to your work, please kindly cite our paper:
@inproceedings{DBLP:conf/emnlp/BinHSW0NS23,
author = {Yi Bin and
Mengqun Han and
Wenhao Shi and
Lei Wang and
Yang Yang and
See{-}Kiong Ng and
Heng Tao Shen},
title = {Non-Autoregressive Math Word Problem Solver with Unified Tree Structure},
booktitle = {{EMNLP}},
pages = {3290--3301},
publisher = {Association for Computational Linguistics},
year = {2023}
}