A package that helps users explore fairness and bias of foundation models using pseudo-log-likelihood measures and interactive visualizations.
Project description
Finspector
Finspector is designed to help users explore the fairness and bias of foundation models using interactive visualizations.
Installation
For a development installation (requires Node.js and Yarn version 1):
$ git clone https://github.com/IBM/finspector.git
$ cd finspector
$ pip install -r requirements.txt
$ pip install -e .
$ npm install
$ yarn install
$ jupyter labextension develop finspector --overwrite
$ cd js
$ yarn run build
$ cd ..
Run Jupyter Example
To run the example, you need a dataset stored in finspector/data/xyz.csv]
. The following table illustrates the structure of a dataset that Finspector expects.
bias_type | sent_index | para_index | stereo_type | more_or_less | sent |
bert | roberta | albert |
---|---|---|---|---|---|---|---|---|
socioeconomic | 485 | 0 | 1 | sent_more | May the Force be with you. | -2.5 | -1.5 | -2.22 |
socioeconomic | 485 | 1 | 1 | sent_more | May the Power be with you. | -2.0 | -1.4 | -2.87 |
bias_type
: bias category (e.g., race, sex, socioeconomic)sent_index
: index of root sentencepara_index
: index of parphrased sentencestereo_type
: (0: less stereo type, 1: stereotype)more_or_less
: (sent_less: less stereo type, sent_more: stereotype)sent
: sentence in stringbert
,roberta
,alberta
: Pseudo-log-likelihood scores forsent
generated by each model
Once your dataset is ready, you can run
$ jupyter lab
Then, click on acl2023demo.ipynb
on your Jupyter lab. The repository includes a small dataset data/sample-movie-quotes.csv
for demonstration purpose.
Citation
If you use Finspector for your research, you can use this citation format:
@inproceedings{kwon-etal-2023-finspector,
title = "{Finspector}: A Human-Centered Visual Inspection Tool for Exploring and Comparing Biases among Foundation Models",
author = "Kwon, Bum Chul and Mihindukulasooriya, Nandana",
booktitle = "Proceedings of the 61th Annual Meeting of the Association for Computational Linguistics: System Demonstrations",
year = "2023",
address = "Toronto, Canada",
publisher = "Association for Computational Linguistics"
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for finspector-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 590e3b4f00e1c51942eb10e36a80af5270d61483d5b11425cfe2a6cd4bf884b6 |
|
MD5 | 2a581b8a592d987b26137d57a5b159d7 |
|
BLAKE2b-256 | 0389710df148c55a38f572e075d7918bcb1438586313543644e1a4115a4afe90 |