Giter Club home page Giter Club logo

danish-ner-bias's Introduction

Detecting intersectionality in NER models: A data-driven approach

This repository contains the code used to produce the results in the paper "Detecting intersectionality in NER models: A data-driven approach" by Lassen et al. (2023).

The project investigates the effect of intersectional biases in Danish language models (see list) used for Named Entity Recognition (NER). This is achieved by applying a data augmentation technique, namely augmenting all names in the DaNe testset on gender-divided name lists for both majority and minority names.

For instructions on how to reproduce the results, please refer to the Pipeline section.

Project structure

The repository has the following directory structure:

Description
name_lists Contains name lists used for data augmentation
requirements Requirements file for all models, and a seperate file for polyglot
results Results from all model evaluations saved as CSV files
src Contains scripts for evaluating all models (evaluate_XX.py). Also has helper modules for preprocessing name lists (process_names), importing models (apply_fns), and augmenting names + evaluating models (evaluate_fns).
utils-R Utils for running results.md
results.md Rmarkdown for producing results table from the paper (Table 2)
polyglot.sh Installs necessary tools and packages and runs the evaluation of polyglot
setup.sh Installs necessary packages for running evaluation of all models except polyglot
run-models.sh Runs the evaluation of all models except polyglot

Danish language models

The following models are evaluated:

Pipeline

The pipeline has been built on Ubuntu (UCloud).

For all models except polyglot, first run the setup.sh

bash setup.sh

This will create a virtual environment (env) and install the necessary packages.

To then evaluate all models, run:

bash run-models.sh

Polyglot

To setup and evaluate polyglot, run:

sudo bash polyglot.sh

NB! Notice that it is necessary to run this code with sudo as the setup requires certain devtools that will not be installed otherwise. Run at own risk!

The polyglot.sh script will both install devtools, packages and run the evaluation of the model in a seperately created environment called polyenv.

Acknowledgements

The name augmentation was performed using augmenty and model evaluation was performed using the DaCy framework.

danish-ner-bias's People

Contributors

kennethenevoldsen avatar minaalmasi avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

dadebias

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.