Skip to main content

GenderPerformr

Intro

GenderPerformr is the model release from the paper It’s going to be okay: Measuring Access to Support in Online Communities by Zijian Wang and David Jurgens (in proceedings of EMNLP 2018).

It is the current state-of-the-art method that predicts gender from usernames based on a LSTM model built in PyTorch (as of Sept. 2018).

See the project website for full details, including contact information.

Install

Use pip

If pip is installed, genderperformr could be installed directly from it:

pip install genderperformr

From raw

git clone the project and do:

python setup.py install

Dependencies

python>=3.6.0
torch>=0.4.1
numpy
unidecode

Usage and Example

predict

predict is the core method of this package, which takes a single username of a list of usernames, and returns a tuple of raw probabilities in [0,1] (0 - Male, 1 - Female), and labels (M - Male, N - Neutral, F - Female, empty string - others).

Simplest usage

You may directly import genderperformr and use the default predict method, e.g.:

>>> import genderperformr
>>> genderperformr.predict("AdamMcAdamson")
(0.019139649, 'M')

Construct from class

Alternatively, you may also construct the object from class, where you could customize the model path and device:

>>> from genderperformr import GenderPerformr
>>> gp = GenderPerformr()

# Predict a single username
>>> gp.predict("John")
(0.087956183, 'M')

# Predict a list of names
>>> probs, labels = gp.predict(["BarryCA67", "pizzamagic", "KatieZ22"])
>>> f"Raw probabilities are {probs}"
Raw probabilities are [0.03398224 0.5439474 0.93964571]
>>> f"Labels are {labels}"
Labels are ['M', 'N', 'F']

More detail on how to construct the object is available in docstrings.

Model using new data partition

If you want to use the model described in Supplemental Material using the new data partition, you may construct the object via

>>> gp = GenderPerformr(is_new_model=True)

All other usages remain the same.

Citation

@inproceedings{wang2018its,
       title={It's going to be okay: Measuring Access to Support in Online Communities},
       author={Wang, Zijian and Jurgens, David},
       booktitle={Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP)},
       year={2018}
}

Contact

Zijian Wang (zij<last_name>@stanford.edu)

David Jurgens (<last_name>@umich.edu)

Metadata

Release files for genderperformr 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genderperformr 1.2
File Size Uploaded
genderperformr-1.2.tar.gz 91.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for genderperformr 1.2
File Interpreter ABI Platform
genderperformr-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 182.0 MB

Release files / genderperformr-1.2.tar.gz

Download URL genderperformr-1.2.tar.gz
Size 91.0 MB
Tags Source
SHA-256 checksum
How to use checksums
aca2c2a1ad8976920f85afef7abb7d5663bd5863a837a9e729380385a9cd16b8
BLAKE2b-256 checksum
How to use checksums
9e0223890cabc26aef4a2075d6c2ec305d4d576b31c591a489b91a81df529ac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

Release files / genderperformr-1.2-py3-none-any.whl

Download URL genderperformr-1.2-py3-none-any.whl
Size 91.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0fc580b2f791cfa671bf6d5d0a06c5775e840295112abb20182ba406856b595a
BLAKE2b-256 checksum
How to use checksums
00a0217450fe847db706223932008c90f80a357ec61bd969fb401e0c1fce0579
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

1 release file

1.0

2 release files

0.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page