Giter VIP home page Giter VIP logo

syiswell / cross-modal-ablation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from e-bug/cross-modal-ablation

0.0 1.0 0.0 113.89 MB

Code and data for our paper "Vision-and-Language or Vision-for-Language? On Cross-Modal Influence in Multimodal Transformers", EMNLP 2021.

License: MIT License

Shell 8.40% Jupyter Notebook 57.82% Python 23.69% Cuda 4.60% C++ 5.41% C 0.01% Makefile 0.02% CSS 0.04% HTML 0.02% Dockerfile 0.01%

cross-modal-ablation's Introduction

Cross-Modal Ablation

This is the implementation of the approaches described in the paper:

Stella Frank*, Emanuele Bugliarello* and Desmond Elliott. Vision-and-Language or Vision-for-Language? On Cross-Modal Influence in Multimodal Transformers. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP), Nov 2021.

We provide the code for reproducing our results.

The cross-modal ablation task has also been integrated into VOLTA, upon which our repository was origally built.

Repository Setup

You can clone this repository issuing:
git clone [email protected]:e-bug/cross-modal-ablation

1. Create a fresh conda environment, and install all dependencies.

conda create -n xm-influence python=3.6
conda activate xm-influence
pip install -r requirements.txt

2. Install apex. If you use a cluster, you may want to first run commands like the following:

module load cuda/10.1.105
module load gcc/8.3.0-cuda

3. Setup the refer submodule for Referring Expression Comprehension:

cd tools/refer; make

Data

For textual data, please clone the Flickr30K Entities repository:
[email protected]:BryanPlummer/flickr30k_entities.git

For visual features, we use the VOLTA release for Flickr30K.

Our datasets directory looks as follows:

data/
 |-- flickr30k/
 |    |-- resnet101_faster_rcnn_genome_imgfeats/
 |
 |-- flickr30k_entities/
 |    |-- Annotations/
 |    |-- Sentences/
 |    |-- val.txt

Once you have defined the path to your datasets directory, make sure to update the cross-modal influence configuration file (e.g. volta/config_tasks/xm-influence_test_tasks.yaml).

Our Dataset class for cross-modal ablation on Flickr30K Entites is implemented in volta/volta/datasets/flickr30ke_ablation_dataset.py.

The LabelMatch subset can be derived following the notebook notebooks/Data-MakeLabelMatch.ipynb.

Models

Most of the models we evaluated were released in VOLTA (Bugliarello et al., 2021).

If you are interested in using some of the variations we studied in our paper, reach out to us or open an issue on GitHub.

Training and Evaluation

We introduce the following scripts in this repository:

We provide all the scripts we used in our study under experiments/.

We share our results aggregated in TSV files under notebooks/.

License

This work is licensed under the MIT license. See LICENSE for details. Third-party software and data sets are subject to their respective licenses.
If you find our code/data/models or ideas useful in your research, please consider citing the paper:

@inproceedings{frank-etal-2021-vision,
    title = "Vision-and-Language or Vision-for-Language? {O}n Cross-Modal Influence in Multimodal Transformers",
    author = "Frank, Stella and Bugliarello, Emanuele and
      Elliott, Desmond",
    booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP 2021)",
    month = "nov",
    year = "2021",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/2109.04448",
}

cross-modal-ablation's People

Contributors

e-bug avatar

Watchers

James Cloos 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.