GithubHelp home page GithubHelp logo

poe's Introduction

Power of Explanations - PoE

Hi there, this repository contains the source code and necessary resources of the paper:
Power of Explanations: Towards automatic debiasing in hate speech detection
Yi Cai, Arthur Zimek, Gerhard Wunder, Eirini Ntoutsi (Preprint on arxiv)

Dependencies

Most of the experiments were carried out on Colab. The dependencies are therefore derived from the Colab's environment at the time the code was runned.

  • Python: 3.7.13
  • Pytorch: 1.12.1+cu113
  • boto3: 1.24.68
  • pyyaml: 6.0
  • tqdm: 4.64.0

Dataset

The full Gab Hate Corpus can be downloaded via GHC under the ./Data folder, with the ghc_train.tsv containing the training set and ghc_test.tsv containing the test & validation set. A random split is performed on ghc_test.tsv for the preparation of the test & validation sets.

Files should be converted after the split into .jsonl format, namely train.jsonl, dev.jsonl, test.jsonl, and stored under the folder: ./data/majority_gab_dataset_25k/ (or any other path with the corresponding configuration updated).

Training

To train the model with MiD, simply run the following command, the other two supported modes are vanilla and soc, referring to the vanilla BERT and the baseline.

python launch.py --mode mid

Configurations on the whole framework can be found under the ./utils folder with the ending .yaml. Alter the parameters could also be done in the command line instead of editing the configuration file, e.g. change the random seed and the training mode:

python launch.py --seed 1 --mode vanilla

the same holds for other parameters in the 3 configuration files.

Detailed information during training will be stored as a list under the root of the workspace in a .pkl file, the list contains:

  1. loss
  2. regularized attribution penalty
  3. debiasing lists over iterations
  4. attribution and fpp of the corresponding token found by MiD over iterations in class AttrRecord
  5. attribution and fpp of the corresponding token listed in baseline over iterations in class AttrRecord

poe's People

Contributors

caiy0220 avatar

Stargazers

Sheetal Srivastava avatar

Watchers

 avatar

Forkers

aiml-research

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.