Coder Social home page Coder Social logo

revisit-mmt's Introduction

Good for Misconceived Reasons: An Empirical Revisiting on the Need for Visual Context in Multimodal Machine Translation

This repo contains code needed to replicate our findings in the ACL’2021 paper as titled. Our implementation is based on FairSeq.

Setup conda environment (recommanded)

  • conda create --name revisit python=3.7.6
  • conda activate revisit
  • pip install transformers==3.0.2
  • conda install pytorch==1.5.0 torchvision==0.6.0 cudatoolkit=10.1 -c pytorch
  • cd Revisit-MMT/
  • pip install --editable ./

Resources

File Name Description Download
resnet50-avgpool.npy pre-extracted image features, each image is represented as a 2048-dimensional vector. Link
retriever.bin pre-trained text->image retriever Link
checkpoints pre-trained Transformer/Gated Fusion/RMMT on Multi30K En-De for quick reproduction Link

Example Usage

# We have included pre-processed (BPE,re-index image) raw data from Multi30K En-De/Fr in the repo, 
# with the following format (take train set as an example):

train.en # source sentence
train.de # target sentences
train.vision.en # image id associated with each source sentence
# We re-index image id from 0 to #number of images for convinence
train.bert.en # the source sentence (without bpe) used for retrieval

Transformer basleine on Multi30K En-De

Gated Fusion on Multi30K En-De

PS: you need to download pre-extracted visual features to train a Gated Fusion model.

RMMT on Multi30K En-De

PS: you need to download pre-extracted visual features and a pre-trained image retriever to tran RMMT.

revisit-mmt's People

Contributors

lividwo 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.