Code Monkey home page Code Monkey logo

com2sense's Introduction

Com2Sense

This repo contains the dataset and baseline model weights for Com2Sense Benchmark.

It also provides access to Leaderboard submission.


Table of Contents


Dataset

The directory is structured as follows:

com2sense
├── train.json
├── dev.json
└── test.json

com2sense
├── pair_id_train.json
├── pair_id_dev.son
└── pair_id_test.json

Each data file has the following format:


[   
    {
        "id": "",
        "sent": "",
        "label": "",
        "domain": "",
        "scenario": "",
        "numeracy": ""
    },
    ...
  ]

For test.json, the ground-truth labels are excluded.

Pair id files are used to get data pair information and could be used to calculate pairwise accuracy.


Models

Model Std / Pair Accuracy Weights
UnifiedQA-3B 71.31 / 51.26 Link
DeBerta-large 63.53 / 45.30 ...

Training

For training we provide a sample script, with custom arguments (train.sh)

$ python3 main.py \
--mode train \
--dataset com2sense \
--model roberta-large \
--expt_dir ./results \
--expt_name roberta \
--run_name demo \
--seq_len 128 \
--epochs 100 \
--batch_size 16 \
--acc_step 4 \
--lr 1e-5 \
--log_interval 500 \
--gpu_ids 0,1,2,3 \
--use_amp T \
-data_parallel

The log directory for this sample script would be ./results/roberta/demo/

The Train & Validation metrics are logged to TensorBoard.

$ tensorboard --logdir ...

Note: logdir = expt_dir/expt_name/run_name/


Inference

TO-DO

For inference on dev set, we can modify as follows (test.sh):

$ python3 main.py \
--mode test \
--model roberta-large \
--dataset com2sense \
--ckpt ./path_to_model.pth
--test_file test \
--pred_file roberta_large_results.csv 

Leaderboard

To test your own model, modify the line 128:

model = Transformer(args.model, args.num_cls, text2text, num_layers=args.num_layers)

To evaluate on the official test set, we have two modes:

  • Evaluation

Run with eval mode

$ python3 leaderboard.py \
--mode eval \
--ckpt /expt_dir/expt_name/run_name/model.pth

Output:

{
    'pairwise': 0.25,
    'standard': 0.50
}
  • Submit

Fill in the information in submit.yaml, and then run with submit mode

$ python3 leaderboard.py \
--mode submit \
--ckpt /expt_dir/expt_name/run_name/model.pth \
--user_info ./submit.yaml

You can view the leaderboard at URL


com2sense's People

Contributors

axe-- avatar houyu0930 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.