Skip to main content

A package for quantifying bias in Danish language models.

Project description


Logo

The GenDa Lens:

Quantifying Gender Bias in Danish language models

Thea Rolskov Sloth & Astrid Sletten Rybner

A python package for investigating gender bias in Danish language models within the following domains:

  • Language Modeling (for pre-trained models)

  • Coreference Resolution (for coref. models)

  • Named Entity Recogntiion (for NER models)


If you want to test either a pre-trained model, a coref. model or a NER model, you can read more about each of these three types of tests in the User Guide.

Here you can also find a section on the defintions of harm, gender and bias that we adopt in the GenDa Lens package.

🔎 Documentation

Documentation
📚 User Guide Instructions on how to understand the implemented Gender Bias tests
💡 Definitions Defintions of harm, bias and gender applied in GenDa Lens
💻 API References The detailed reference for the GenDa lens API. Including function documentation
🧐 About Learn more about how this project came about and who is behind the implemented frameworks

🤗 Integration

Note that for NER and Language Modeling, the GenDa Lens evaluator is integrated with Hugging Face.

🔧 Installation

You can install GenDa Lens via pip from PyPI:

pip install genda_lens

👩‍💻 Usage

You can test your model by instatiating an instance of the Evaluator and running the appriate evaluation function:

from genda_lens import Evaluator

# initiate evaluator
ev = Evaluator(model_name="huggingface-modelname")

# run test
output = ev.evaluate_ner(n=20)

# retrieve output
simple_output = output[0]
detailed_output = output[1]

Subsequently, the output can be visualized using the Visualizer:

from genda_lens import Visualizer

# initiate visualizer
viz = Visualizer()

# visualize ner results
plot = viz.visualize_results(data = detailed_output_ner, framework = "ner", model_name "my-model-name")

Acknowledgements

This project uses code from three already implemented frameworks for quantifying gender bias in Danish. While all code written by others is properly attributed at the top of the scripts in the repository, we would also like to present aknowledgement here to the authors of the work we draw on:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genda_lens-0.0.3.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genda_lens-0.0.3-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file genda_lens-0.0.3.tar.gz.

File metadata

  • Download URL: genda_lens-0.0.3.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.9.7 Darwin/21.6.0

File hashes

Hashes for genda_lens-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3c85a0a2644de7df744490c0f9d4280e4c00edf8e87b857b8620053ae08807c7
MD5 18f30a6595d636d4159cff63105b5dde
BLAKE2b-256 f0c265d6484b83a005ca47a6dc35e5efa73fd11d61fb5842960ac090051b5c11

See more details on using hashes here.

File details

Details for the file genda_lens-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: genda_lens-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.9.7 Darwin/21.6.0

File hashes

Hashes for genda_lens-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 92a05b35482e9c8ae50314068e46f2eb637422d3f3690f0db9c76bd2df3b2dfa
MD5 f995d98eb642109be1a6be39db905c8f
BLAKE2b-256 052ff814faf168d0e89a3ae16fae4d4ad49a0db143f651fc0cfee3c9672a3368

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page