Necessity and Sufficiency for Explaining Text Classifiers: A Case Study in Hate Speech Detection

Esma Balkir, Isar Nejadgholi, Kathleen C. Fraser, Svetlana Kiritchenko
5/6/2022
cs.CL

Official code: esmab/necessity-sufficiency (6 stars, Jupyter Notebook, last commit 2022-10-03).

Abstract

We present a novel feature attribution method for explaining text classifiers, and analyze it in the context of hate speech detection. Although feature attribution models usually provide a single importance score for each token, we instead provide two complementary and theoretically-grounded scores -- necessity and sufficiency -- resulting in more informative explanations.

Show full abstract

We propose a transparent method that calculates these values by generating explicit perturbations of the input text, allowing the importance scores themselves to be explainable. We employ our method to explain the predictions of different hate speech detection models on the same set of curated examples from a test suite, and show that different values of necessity and sufficiency for identity terms correspond to different kinds of false positive errors, exposing sources of classifier bias against marginalized groups.

View on arXivView PDF

Code Implementations(1)

Code for the NAACL 2022 paper "Necessity and Sufficiency for Explaining Text Classifiers: A Case Study in Hate Speech Detection"

62Jupyter Notebook, PythonMay 17, 20224 years ago

Similar Papers

Cite this paper

@article{balkir2022necessity,
  title  = {Necessity and Sufficiency for Explaining Text Classifiers: A Case Study in Hate Speech Detection},
  author = {Esma Balkir and Isar Nejadgholi and Kathleen C. Fraser and Svetlana Kiritchenko},
  year   = {2022},
  eprint = {2205.03302},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.03302}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.03302.svg)](https://codeofpaper.com/paper/2205.03302)

Discussion