Skip to content

About

The official repository of the EACL2024-Findings paper: Understanding and Mitigating Spurious Correlations in Text Classification with Neighborhood Analysis

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

doNt-Forget-your-Language

The official repository of our EACL2024-Findings paper: Understanding and Mitigating Spurious Correlations in Text Classification with Neighborhood Analysis.

  • 🎯 Problem Text classification models are prone to over reliance on spurious correlations that exist in the training set but may not hold true in general circumstances.
  • ✅ Solution We demystify this underlying representation space and propose a simple yet effective mitigation method, doN't Forget your Language (NFL).
  • 📝 Paper https://aclanthology.org/2024.findings-eacl.68/
  • 🙌 Collaboration This project is a collaborative effort between National Taiwan University (NTU), University of California, Los Angeles (UCLA) and University of Illinois Urbana-Champaign (UIUC).

Installation

Assuming Miniconda is installed, run the following commands to set up the environment:

conda create -n nfl python=3.8
conda activate nfl
pip install -r requirements.txt

Usage

Data: The processed datasets are available in the data directory. To create biased, unbiased, or filtered subsets for your custom datasets, refer to src/create_subsets.py.

Models: To reproduce the results in our paper, run src/nfl.py for NFL or src/dfr.py for the DFR baseline, which we re-implemented.

Erratum

The Appendix B in the paper mistakenly shows $[BOS], w_1, ..., w_k, [EOS]$ as the input for neighborhood analysis. The actual implementation uses $w_1, ..., w_k$ as shown in this repository.

Citation

If you find our work helpful, please consider citing our paper. Thank you!

@inproceedings{chew-etal-2024-understanding,
    title = "Understanding and Mitigating Spurious Correlations in Text Classification with Neighborhood Analysis",
    author = "Chew, Oscar  and
      Lin, Hsuan-Tien  and
      Chang, Kai-Wei  and
      Huang, Kuan-Hao",
    editor = "Graham, Yvette  and
      Purver, Matthew",
    booktitle = "Findings of the Association for Computational Linguistics: EACL 2024",
    month = mar,
    year = "2024",
    address = "St. Julian{'}s, Malta",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.findings-eacl.68",
    pages = "1013--1025",
}

About

The official repository of the EACL2024-Findings paper: Understanding and Mitigating Spurious Correlations in Text Classification with Neighborhood Analysis

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages