Giter Club home page Giter Club logo

hateful-memes's Introduction

Hateful Memes Example using MMF

  • Kiela, D., Firooz, H., Mohan A., Goswami, V., Singh, A., Ringshia P. & Testuggine, D. (2020). The Hateful Memes Challenge: Detecting Hate Speech in Multimodal Memes. arXiv preprint arXiv:2005.04790
@article{kiela2020hateful,
  title={The Hateful Memes Challenge: Detecting Hate Speech in Multimodal Memes},
  author={Kiela, Douwe and Firooz, Hamed and Mohan, Aravind and Goswami, Vedanuj and Singh, Amanpreet and Ringshia, Pratik and  Testuggine, Davide},
  journal={arXiv preprint arXiv:2005.04790},
  year={2020}
}

Links: [arxiv] [challenge] [blog post]

The example tries to replicate the model developed in DrivenData's blog post on the Hateful Memes.

Installation

Preferably, you would create your own conda environment like the following:

git clone [email protected]:holman57/Hateful-Memes.git
cd Hateful-Memes
conda create --name mmf
conda activate mmf
conda install -c anaconda pip
pip install -r requirements.txt

Prerequisites

Please follow prerequisites for the Hateful Memes dataset at this link.

Running

Run training with the following command on the Hateful Memes dataset:

MMF_USER_DIR="." mmf_run config="configs/experiments/defaults.yaml"  model=concat_vl dataset=hateful_memes training.num_workers=0

We set training.num_workers=0 here to avoid memory leaks with fasttext. Please follow configuration document to understand how to use MMF's configuration system to update parameters.

Directory Structure

├── configs
│   ├── experiments
│   │   └── defaults.yaml
│   └── models
│       └── concat_vl.yaml
├── __init__.py
├── models
│   ├── concat_vl.py
├── processors
│   ├── processors.py
├── README.md
└── requirements.txt

Some notes:

  1. Configs have been divided into experiments and models where experiments will contain training configs while models will contain model specific config we implmented.
  2. __init__.py imports all of the relevant files so that MMF can find them. This is what env.user_dir actually looks for.
  3. models directory contains our model implementation, in this case specifically concat_vl.
  4. processors contains our project specific processors implementation, in this case, we implemented FastText processor for Sentence Vectors.

hateful-memes's People

Contributors

holman57 avatar jaw-ahm 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.