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 forsentgenerated 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finspector-0.1.0.tar.gz.
File metadata
- Download URL: finspector-0.1.0.tar.gz
- Upload date:
- Size: 559.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2e45b3e4239deac0ff617b15d960ba9c51b235c0351b64ecafe5efb1b8a3039
|
|
| MD5 |
c8258e12d26979d90046fd9b408a8bc6
|
|
| BLAKE2b-256 |
2086ae993f988c3fe40b78dcb4bf708bc81963f69bda218d8885028d3ba7e549
|
File details
Details for the file finspector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: finspector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 650.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
590e3b4f00e1c51942eb10e36a80af5270d61483d5b11425cfe2a6cd4bf884b6
|
|
| MD5 |
2a581b8a592d987b26137d57a5b159d7
|
|
| BLAKE2b-256 |
0389710df148c55a38f572e075d7918bcb1438586313543644e1a4115a4afe90
|