Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joaoalvarenga/namegenderclassifier
Gender classification by name
https://github.com/joaoalvarenga/namegenderclassifier
brasil brazil classificador classifier gender genero keras mlp neural-network nome perceptron portugues portuguese
Last synced: 3 months ago
JSON representation
Gender classification by name
- Host: GitHub
- URL: https://github.com/joaoalvarenga/namegenderclassifier
- Owner: joaoalvarenga
- License: mit
- Created: 2017-05-30T23:33:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T04:25:10.000Z (over 7 years ago)
- Last Synced: 2024-08-02T14:08:01.752Z (6 months ago)
- Topics: brasil, brazil, classificador, classifier, gender, genero, keras, mlp, neural-network, nome, perceptron, portugues, portuguese
- Language: Python
- Size: 211 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-polyglot - name-gender-classifier - Classify the gender of a Portuguese name. (Python Packages)
README
# Name Gender Classifier
![built with](https://img.shields.io/badge/Built%20with-Python%203-green.svg)A gender classifier based on first names.
This classifier implements a single layer perceptron as main classifier.
It uses name's last 3-gram and character frequency as features into the classifier.## Dataset
With brazilian names dataset, my current numbers are:
```
Accuracy: 0.759988
Precision: 0.753677
Recall: 0.756184
F1: 0.754929
```# Quick start
## Requirements
This project uses Python 3 specifications
Install all project dependencies via pip after cloning project
```
$ python setup.py install
$ pip install -r requirements.txt
```
## Training example
```python
from genderclassifier import GenderClassifier
import pandas as pddataset = pd.read_csv("data/nomes.csv").values
classifier = GenderClassifier()
classifier.train(dataset)
classifier.save("models/example")
precision, recall, accuracy, f1 = classifier.evaluate(dataset)
print("Accuracy: %f" % accuracy)
print("Precision: %f" % precision)
print("Recall: %f" % recall)
print("F1: %f" % f1)
```## Predicting
```python
from genderclassifier import GenderClassifier
classifier = GenderClassifier()
classifier.load("models/example")
name = input()
while name is not "q":
pred = classifier.predict([name])
print("%s - %s" % (name, pred))
name = input()
```# License
MIT License# Contributing
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
Steps to contribute:
- Make your awesome changes
- Submit pull request
- You can also help sharing better datasets ;)