WEFE API

This is the documentation of the API of WEFE.

WordEmbeddingModel

WordEmbeddingModel(wv[, name, vocab_prefix])

A wrapper for Word Embedding pre-trained models.

Query

Query(target_sets, attribute_sets[, ...])

A container for attribute and target word sets.

Metrics

This list contains the metrics implemented in WEFE.

WEAT()

Word Embedding Association Test (WEAT).

RND()

Relative Norm Distance (RND).

RNSB()

Relative Relative Negative Sentiment Bias (RNSB).

MAC()

Mean Average Cosine Similarity (MAC).

ECT()

Embedding Coherence Test [1].

RIPA()

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.

HardDebias([pca_args, verbose, criterion_name])

Hard Debias debiasing method.

MulticlassHardDebias([pca_args, verbose, ...])

Generalized version of Hard Debias that enables multiclass debiasing.

Dataloaders

The following functions allow one to load word sets used in previous works.

load_bingliu()

Load the Bing-Liu sentiment lexicon.

fetch_debias_multiclass()

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_debiaswe()

Fetch the word sets used in the paper Man is to Computer Programmer as Woman is to Homemaker? from the source.

fetch_eds([occupations_year, ...])

Fetch the word sets used in the experiments of the work Word Embeddings *Quantify 100 Years Of Gender And Ethnic Stereotypes.

load_weat()

Load the word sets used in the paper Semantics Derived Automatically From Language Corpora Contain Human-Like Biases.