Code Monkey home page Code Monkey logo

semeval2020-code's Introduction

Commonsense Validation and Explanation Task

This repository contains the code for our submission to SemEval-2020 task 4: Commonsense Validation and Explanation Task (ComVe). The task is explained in the picture below. Please look at the paper here for more details

The data provided by the task organizers is available under the following repository.

Subtask A and B will are evaluated using accuracy. Subtask C is evaluated using BLEU score.

alt text

How to run the code

Setup

  export COMVE_DIR=/path/to/COMVE_data_dir
  export OUTPUT_DIR=/path/to/output_dir 
  conda create -n comve_env python=3.6
  conda activate comve_env
  pip3 install requirements.txt

Task A

  python3 ./run_taskA.py \
          --model_type bert \
          --task_name swag \
          --model_name_or_path bert-base-uncased \
          --do_train \
          --do_eval \
          --do_test \
          --data_dir $COMVE_DIR \
          --learning_rate 5e-5 \
          --num_train_epochs 3 \
          --max_seq_length 80 \
          --output_dir $OUTPUT_DIR \
          --per_gpu_eval_batch_size=8 \
          --per_gpu_train_batch_size=8 \
          --gradient_accumulation_steps 2 \
          --overwrite_output > results.csv 

Task B

  export COMVE_DIR=/path/to/COMVE_data_dir 
  export OUTPUT_DIR=/path/to/output_dir 
  python3 ./run_taskB.py \
  --model_type bert \
  --task_name swag \
  --model_name_or_path bert-base-uncased\
  --do_train \
  --do_eval \
  --do_test \
  --data_dir $COMVE_DIR \
  --learning_rate 5e-5 \
  --num_train_epochs 3 \
  --max_seq_length 80 \
  --output_dir $OUTPUT_DIR \
  --per_gpu_eval_batch_size=8 \
  --per_gpu_train_batch_size=8 \
  --gradient_accumulation_steps 2 \
  --overwrite_output > results.csv

Credits

Hugging Face Transformer Library

We use and modify the code provided by Hugging Face library for Multiple Choice Tasks that are publically available. We procide a link to the original code for a SWAG example by Hugging Face here and the paper here

semeval2020-code's People

Contributors

phaelishall avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

semeval2020-code's Issues

Possibly Wrong training set ?

Hi ,
I am using your code to reproduce the results for SemEval2020-Task4-Commonsense-Validation-and-Explanation.

given the data from the correct repository.

Now when I run the given code it expects to have a label column in train.csv file, However, in the given train.csv file it don't exsits.

would be great if you give an explanation

Asking for the requirement.txt

Could you please provide the requirement.txt file?I want to run your code, but the environment has not been very correct, thank you very much.

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.