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:
-
The original ABC Framework: González, A. V., Barrett, M., Hvingelby, R., Webster, K., & Søgaard, A. (2020). Type B reflexivization as an unambiguous testbed for multilingual multi-task gender bias.
-
The original Augmented DaNe Framework: Lassen, I. M., Almasi, M., Enevoldsen, K., & Kristensen-mclachlan, R. (2023, May). Detecting intersectionality in NER models: A data-driven approach.
-
The original WinoBias Framework: Zhao, J., Wang, T., Yatskar, M., Ordonez, V., & Chang, K. W. (2018). Gender bias in coreference resolution: Evaluation and debiasing methods.
-
The Danish translation of the WinoBias Framework, DaWinoBias: Signe Kirk and Kiri Koppelgaard
Metadata
Release files for genda-lens 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| genda_lens-0.0.3.tar.gz | 2.1 MB | Without provenance | Details for genda_lens-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| genda_lens-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for genda_lens-0.0.3-py3-none-any.whl |
Total release size: 4.3 MB
Release files / genda_lens-0.0.3.tar.gz
| Download URL | genda_lens-0.0.3.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c85a0a2644de7df744490c0f9d4280e4c00edf8e87b857b8620053ae08807c7
|
|
BLAKE2b-256 checksum How to use checksums |
f0c265d6484b83a005ca47a6dc35e5efa73fd11d61fb5842960ac090051b5c11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.9.7 Darwin/21.6.0
|
Release files / genda_lens-0.0.3-py3-none-any.whl
| Download URL | genda_lens-0.0.3-py3-none-any.whl |
|---|---|
| Size | 2.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92a05b35482e9c8ae50314068e46f2eb637422d3f3690f0db9c76bd2df3b2dfa
|
|
BLAKE2b-256 checksum How to use checksums |
052ff814faf168d0e89a3ae16fae4d4ad49a0db143f651fc0cfee3c9672a3368
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.9.7 Darwin/21.6.0
|
Security for genda-lens 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.