Giter Site home page Giter Site logo

math_seq2tree's Introduction

A Goal-Driven Tree-Structured Neural Model for Math Word Problems

This repository is the PyTorch implementation for the IJCAI 2019 accepted paper:

Zhipeng Xie* and Shichao Sun*, A Goal-Driven Tree-Structured Neural Model for Math Word Problems IJCAI 2019.

* indicates equal contribution.

Seq2Tree Model

A Seq2Tree Neural Network containing top-down Recursive Neural Network and bottom-up Recursive Neural Network

Requirements

Train and Test

  • Math23K:
python3 run_seq2tree.py

Results

Model Accuracy
Hybrid model w/ SNI 64.7%
Ensemble model w/ EN 68.4%
Seq2Tree w/o Bottom-up RvNN 70.0%
Seq2Tree 74.3%

Citation

@inproceedings{ijcai2019-736,
  title     = {A Goal-Driven Tree-Structured Neural Model for Math Word Problems},
  author    = {Xie, Zhipeng and Sun, Shichao},
  booktitle = {Proceedings of the Twenty-Eighth International Joint Conference on
               Artificial Intelligence, {IJCAI-19}},
  publisher = {International Joint Conferences on Artificial Intelligence Organization},             
  pages     = {5299--5305},
  year      = {2019},
  month     = {7},
  doi       = {10.24963/ijcai.2019/736},
  url       = {https://doi.org/10.24963/ijcai.2019/736},
}

math_seq2tree's People

Contributors

shichaosun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

math_seq2tree's Issues

源代码细节

作者您好,我在阅读您的代码时不知道num_stack的作用是什么。为什么式子里面有的数字没有被替换成N*呢?
希望能解答下,感谢:)

` for pair in pairs_trained:
num_stack = []
for word in pair[1]:
temp_num = []
flag_not = True
if word not in output_lang.index2word:
flag_not = False
for i, j in enumerate(pair[2]):
if j == word:
temp_num.append(i)

        if not flag_not and len(temp_num) != 0:
            num_stack.append(temp_num)
        if not flag_not and len(temp_num) == 0:
            num_stack.append([_ for _ in range(len(pair[2]))])

    num_stack.reverse()
    input_cell = indexes_from_sentence(input_lang, pair[0])
    output_cell = indexes_from_sentence(output_lang, pair[1], tree)`

Training time of Math23k for an epoch?

Hi,

May I ask how long did you train Math23K for an epoch? Your paper did not mention the concrete training time.

I tried to reimplement this paper. My dataset (4936 instances) needs around 10 min to run an epoch (I modified the data loader as it is kind of outdated), does that make sense?

Thank you

The code doesn't work

Hello GTS author, I just started running the source code and got an error message:
(UserWarning: masked_ fill_ received a mask with dtype torch. uint8, this behavior is now deprecated, please use a mask with dtype torch. bool instead.)
But when I replace it, the results will only be displayed to fold: 1, epoch: 1. There is no result after that. Find the solution, Thank you!

关于generate_tree_input函数

模型对于重复数值处理函数generate_tree_input,这部分代码是不是有问题?
if decoder_output[i, num_start + num] > max_score:
target[i] = num + num_start
max_score = decoder_output[i, num_start + num]
decoder_output的输出是 操作个数+生成数个数+数值数(根据concat的顺序), 这里num_start是操作个数,这里缺少生成数个数

配置环境

请问一下,这个配置环境cuda,cudnn是什么版本的?pytorch=0.4.1的版本现在好像下不到了,其它什么版本的pytorch也能跑吗?谢谢!

数据集

你好,可以给一下另外两个数据集嘛? mawps和roth的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.