onomancer is an open source python package for inferring gender from first names for feature engineering. Name-Gender mappings are based on lookups in the F.txt, M.txt, N.txt
files located in the data
folder created from combining data provided from the Social Security Administration and World Intellectual Property Organization. If a Name-Gender mapping does not exist, the gender is predicted from a pre-trained model named model.bin
also located in the data
folder.
onomancer requires:
- python >= 3.6.x.
- fasttext == 0.9.2 (to load pre-trained model)
$ pip install onomancer
$ python
>>> import onomancer as ono
>>> ono.predict(['GALADRIEL', 'GanDALF'])
{'GANDALF': 'M', 'GALADRIEL': 'F'}