by llamazing

llamazing /numnet_plus

This is the official code repository for NumNet+(

135 Stars 30 Forks Last release: Not found 16 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


This is the official code repository for NumNet+ ( and NumNet+ v2 ( NumNet ( was used as a basis for our work.


If you use the code, please cite the following paper:

  title={{NumNet}: Machine Reading Comprehension with Numerical Reasoning},
  author={Ran, Qiu and Lin, Yankai and Li, Peng and Zhou, Jie and Liu, Zhiyuan},
  booktitle={Proceedings of EMNLP},


pip install -r requirements.txt


Data and pretrained roberta-large preparation.

  • Download drop data.

wget -O

  • Download roberta model.

cd drop_dataset && mkdir roberta.large && cd roberta.large

wget -O pytorch_model.bin
  • Download roberta config file.

wget -O config.json
- Modify
"output_hidden_states": false
"output_hidden_states": true
  • Download roberta vocab files.

wget -O vocab.json

wget -O merges.txt


  • Train with simple multi-span extraction (NumNet+).

    sh 345 5e-4 1.5e-5 5e-5 0.01
  • Train with tag based multi-span extraction (NumNet+ v2, tag based multi-span paper:, github:

    sh 345 5e-4 1.5e-5 5e-5 0.01 tag_mspan


  • Save your model as

    • Simple multi-span extraction (NumNet+).

      sh drop_dataset/drop_dataset_dev.json prediction.json
    • Tag based multi-span extraction (NumNet+ v2).

      sh drop_dataset/drop_dataset_dev.json prediction.json tag_mspan

    python --gold_path drop_dataset/drop_dataset_dev.json --prediction_path prediction.json

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.