Coder Social home page Coder Social logo

ddcot's Introduction

DDCOT

[NeurIPS 2023]DDCoT: Duty-Distinct Chain-of-Thought Prompting for Multimodal Reasoning in Language Models This repository is the official implementation of DDCoT.

DDCoT: Duty-Distinct Chain-of-Thought Prompting for Multimodal Reasoning in Language Models

Ge Zheng∗ , Bin Yang∗, Jiajin Tang*, Hong-Yu Zhou, Sibei Yang†

*Equal contribution; †Corresponding Author image

Requirements

Install all required python dependencies:

pip install -r requirements.txt

Datasets

Download the dataset from the following repository:

https://github.com/lupantech/ScienceQA/tree/main/data

Instructions

Our trained model, extracted visual features and captions and generated rationales are available at Google Drive

Generate Rationale

To generate rationale for one sample,you can run the following code.

python rationale_generation.py

Train

python main.py \
    --model  allenai/unifiedqa-t5-base \
    --user_msg answer --img_type clip \
    --bs 16 --eval_bs 4 --eval_acc 10 --output_len 64 --lr 1e-4 \
    --prompt_format QCMG-A \
    --output_dir model_path --use_generate --final_eval

Inference

python main.py \
    --model allenai/unifiedqa-t5-base \
    --user_msg answer --img_type clip \
    --bs 8 --eval_bs 1 --eval_acc 10 --output_len 64 \
    --final_eval --prompt_format QCMG-A \
    --evaluate_dir model_path --use_generate 

Citing DDCoT

@article{zheng2023ddcot,
  title={Ddcot: Duty-distinct chain-of-thought prompting for multimodal reasoning in language models},
  author={Zheng, Ge and Yang, Bin and Tang, Jiajin and Zhou, Hong-Yu and Yang, Sibei},
  journal={arXiv preprint arXiv:2310.16436},
  year={2023}
}

License

This project is licensed under the Apache-2.0 License.

Acknowledgement

Part of our codes are adapted from ScienceQA.

ddcot's People

Contributors

yangbin55 avatar

Stargazers

jweihe avatar  avatar  avatar Donglearner avatar Manxi Lin avatar  avatar  avatar Thanh Tin Nguyen avatar  avatar Xinyu Liu avatar Ifty Mohammad Rezwan avatar Xu Qingyao avatar Pan Feng avatar  avatar Yao Liu avatar Johnson Hung avatar Zayn avatar hcwei avatar Xiao Feng Zhang avatar  avatar zhenghandong avatar Jonathan Tonglet avatar  avatar Yawei Li avatar Zirui Song avatar darkpromise avatar Qilei Li avatar  avatar  avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

kr-0822

ddcot's Issues

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.