Skip to main content

Pollutes documents with terms biased on specific geners

Project description

Document Polluter


Document Polluter replaces gendered words in documents to create test data for machine learning models in order to identify bias.


document-polluter is available on PyPI

Install via pip

$ pip install document-polluter

Install via easy_install

$ easy_install document-polluter

Install from repo

git repo <>

$ git clone --recursive git://
$ cd document-polluter
$ python install

Basic usage

>>> from document_polluter import DocumentPolluter
>>> documents = ['she shouted', 'my son', 'the parent']
>>> dp = DocumentPolluter(documents=documents, genre='gender')
>>> print(dp.polluted_documents['female'])
['she shouted', 'my daughter', 'the mother']

Running Test

$ python document_polluter/

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for document-polluter, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size document_polluter-0.0.2-py3.8.egg (7.7 kB) File type Egg Python version 3.8 Upload date Hashes View
Filename, size document-polluter-0.0.2.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page