Giter VIP home page Giter VIP logo

raco's Introduction

Code for Retrieval Augmentation for Commonsense Reasoning

Introduction of RACo

  • This is the official resources of our EMNLP 2022 paper "Retrieval Augmentation for Commonsense Reasoning: A Unified Approach" [arXiv].

Step0 Download the Commonsense Corpus

  • Corpus (20M): Google drive [link]

  • Code: Official DPR code [link]

    • first run python merge-corpus.py to construct corpus
    • modify the retrieval corpus path in above the DPR code

Step1 Training: Commonsense Retriever

  • Training Data: Google drive [link]

  • Code: Official DPR code, same as above.

    raco_train:
        _target_: dpr.data.biencoder_data.JsonQADataset
        file: {your folder path}/train.json
    
    raco_dev:
        _target_: dpr.data.biencoder_data.JsonQADataset
        file: {your folder path}/dev.json
    

Step1 Inference: Retrieve Documents

  • Inference Data: Google drive [link]

  • Code: Official DPR code, same as above.

    {dataset}_train:
        _target_: dpr.data.retriever_data.CsvQASrc
        file: {your folder path}/{dataset}/train.tsv
    
    {dataset}_dev:
        _target_: dpr.data.retriever_data.CsvQASrc
        file: {your folder path}/{dataset}/dev.tsv
    
    {dataset}_test:
        _target_: dpr.data.retriever_data.CsvQASrc
        file: {your folder path}/{dataset}/test.tsv
    

Step2 Training and Inference: Commonsense Reader

  • Training Data: obtained from the last step

  • Code: Official FiD code [link]

Step2: FiD Outputs Evaluation

  • Accuracy is the same as exact match in FiD code.

  • BLUE, ROUGE is from the CommonGen GitHub repo.

    • Some commonly seen issues when installing the lib [link]

Citation

@inproceedings{yu2022retrieval,
  title={Retrieval Augmentation for Commonsense Reasoning: A Unified Approach},
  author={Yu, Wenhao and Zhu, Chenguang and Zhang, Zhihan and Wang, Shuohang and Zhang, Zhuosheng and Fang, Yuwei and Jiang, Meng},
  booktitle={Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
  year={2022}
}

Please kindly cite our paper if you find this paper and the codes helpful.

raco's People

Contributors

wyu97 avatar

Stargazers

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

Watchers

 avatar

Forkers

sayontang

raco's Issues

Codes about the paper

Thanks for your wonderful work! I think it is very interesting and meaningful, so I want to follow your work.
Could you please tell me when the code can be displayed? 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.