Created
May 5, 2021 03:49
-
-
Save EricFillion/1f443f17aed371e3b44552f952248f88 to your computer and use it in GitHub Desktop.
NLP: Gender Detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install gender-guesser | |
from gender_guesser.detector import Detector | |
gender_detector = Detector() | |
names = ["Eric", "Kylie", "Spencer", "Erin"] | |
for name in names: | |
result = gender_detector.get_gender(name) | |
print(name + ":", result) | |
# Eric: male | |
# Kylie: female | |
# Spencer: male | |
# Erin: mostly_female |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment