WEFE API¶
This is the documentation of the API of 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 [1]. |
|
An implementation of the Relational Inner Product Association Test, proposed by [1][2]. |
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. |
Dataloaders¶
The following functions allow one to load word sets used in previous works.
Load the Bing-Liu sentiment lexicon. |
Fetch the word sets used in the paper Black Is To Criminals as Caucasian Is To Police: Detecting And Removing Multiclass Bias In Word Embeddings. |
Fetch the word sets used in the paper Man is to Computer Programmer as Woman is to Homemaker? from the source. |
|
Fetch the word sets used in the experiments of the work Word Embeddings *Quantify 100 Years Of Gender And Ethnic Stereotypes. |
Load the word sets used in the paper Semantics Derived Automatically From Language Corpora Contain Human-Like Biases. |
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. |