WEFE API
This reference details all the utilities as well as the metrics and mitigation methods implemented so far in WEFE.
WordEmbeddingModel
A wrapper for Word Embedding pre-trained models. |
Query
|
A container for attribute and target word sets. |
Metrics
This list contains the metrics implemented in WEFE.
Word Embedding Association Test (WEAT). |
|
Relative Norm Distance (RND). |
|
Relative Relative Negative Sentiment Bias (RNSB). |
|
Mean Average Cosine Similarity (MAC). |
|
Embedding Coherence Test (ECT). |
|
Relational Inner Product Association Test (RIPA). |
Debias
This list contains the debiasing methods implemented so far in WEFE.
Hard Debias debiasing method. |
|
|
Generalized version of Hard Debias that enables multiclass debiasing. |
|
Repulsion Attraction Neutralization method. |
Double Hard Debias Method. |
|
|
Half Sibling Debias method. |
Datasets
The following functions allow you to load sets of words used in previous studies.
Load the Bing-Liu sentiment lexicon. |
|
Fetch the word sets used in the paper Black Is To Criminals as Caucasian |
|
Fetch the word sets used in the paper Man is to Computer Programmer as Woman is to Homemaker? from the source. |
|
|
Fetch the sets of words used in the experiments of the _Word Embeddings |
Load the word sets used in the experiments of the |
Preprocessing
The following functions allow transforming sets of words and queries to embeddings. The documentation of the functions in this section are intended as a guide for WEFE developers.
|
pre-processes a word before it is searched in the model's vocabulary. |
Transform a sequence of words into dictionary that maps word - word embedding. |
|
Given a sequence of word sets, obtain their corresponding embeddings. |
|
Obtain the word vectors associated with the provided Query. |
Utils
Collection of assorted utils.
Load a Word2vec subset to test metrics and debias methods. |
|
Generate a list of subqueries from queries. |
|
|
Run several queries over a several word embedding models using a specific metic. |
|
Plot the results obtained by a run_queries execution. |
|
Create a ranking form the aggregated scores of the provided dataframes. |
|
|
Calculate the correlation between the calculated rankings. |
|
|
|
|