WEFE API

This is the documentation of the API of WEFE.

WordEmbeddingModel

WordEmbeddingModel(model, model_name, …)

A container for Word Embedding pre-trained models.

Query

Query(target_sets, attribute_sets, …)

A container for attribute and target word sets.

BaseMetric

metrics.BaseMetric()

A base class to implement any metric following the framework described by WEFE.

WEAT

WEAT()

A implementation of Word Embedding Association Test (WEAT).

RND

RND()

A implementation of Relative Norm Distance (RND).

RNSB

RNSB()

A implementation of Relative Relative Negative Sentiment Bias (RNSB).

ECT

ECT()

An implementation of the Embedding Coherence Test.

Dataloaders

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

Load BingLiu

load_bingliu()

Load the bing-liu sentiment lexicon.

Fetch Debias Multiclass Word sets

fetch_debias_multiclass()

Fetch the word sets used in the paper Black Is To Criminals Caucasian Is To Police: Detecting And Removing Multiclass Bias In Word Embeddings.

Fetch Debias Word Embedding Word Sets

fetch_debiaswe()

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

Fetch Embedding Dynamic Stereotypes Word Sets

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 Word Embedding Association Test Word Sets

load_weat()

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