Code Monkey home page Code Monkey logo

reclor's Introduction

ReClor: A Reading Comprehension Dataset Requiring Logical Reasoning (ICLR 2020)

This repository contains PyTorch code for the paper: Weihao Yu*, Zihang Jiang*, Yanfei Dong, and Jiashi Feng, ReClor: A Reading Comprehension Dataset Requiring Logical Reasoning, ICLR 2020 (* equal contribution). For the data and more information, please check out the project page.

Setting up and using the repo

  1. Set up the environment. Install Python3.5+, PyTorch 1.0+, Transformers and apex. I recommend the Anaconda distribution to set up Python environment. Refer to pytorch.org to install PyTorch. Then install Transformers package by
pip install transformers==2.3.0

Then refer to apex to install Nvidia apex for mixed precision training.

  1. Clone the repo by
git clone https://github.com/yuweihao/reclor.git
  1. Get the dataset. Please visit this Google form link to get the dataset. If you have trouble visiting Google from your area, you can alternatively visit this Tencent form link. Then upzip the downloaded file in the main directory or other directory.

  2. Run the scripts in the main directory by such as

sh scripts/run_roberta_large.sh
  1. (Optional) After running the script, you can find best_dev_results.txt in the checkpoint directory which record the best result on validation set, and the predicted file test_preds.npy for testing set that you can submit to the EvalAI leaderboard to see the accuracy. The predicted file test_preds.npy contains [3, 1, 0, 2, ...] where i-th element represents the predicted label of i-th question with "id_string": "test_i" in test.json.

Results

We obtain the following results with Ubuntu 16.04, NVIDIA driver 430, PyTorch 1.3.1, cudatoolkit 10.1, numpy 1.17.4, NVIDIA apex, and NVIDIA TITAN RTX GPU (we find the results are different between TITAN RTX and GeForce RTX 2080TI when runing large models).

Model Val Test Test-E Test-H
bert-base 54.6 47.3 71.6 28.2
bert-large 53.8 49.8 72.0 32.3
xlnet-base 55.8 50.4 75.2 32.9
xlnet-large 62.0 56.0 75.7 40.5
roberta-base 55.0 48.5 71.1 30.7
roberta-large 62.6 55.6 75.5 40.0

If you could not obtain similar performance in your environment and device, maybe you can try different random seeds.

Bibtex

@inproceedings{yu2020reclor,
        author = {Yu, Weihao and Jiang, Zihang and Dong, Yanfei and Feng, Jiashi},
        title = {ReClor: A Reading Comprehension Dataset Requiring Logical Reasoning},
        booktitle = {International Conference on Learning Representations (ICLR)},
        month = {April},
        year = {2020}
}

reclor's People

Contributors

yuweihao avatar

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.