Skip to content

Instantly share code, notes, and snippets.

@EricFillion
Created May 5, 2021 03:49
Show Gist options
  • Save EricFillion/1f443f17aed371e3b44552f952248f88 to your computer and use it in GitHub Desktop.
Save EricFillion/1f443f17aed371e3b44552f952248f88 to your computer and use it in GitHub Desktop.
NLP: Gender Detection
# 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