Skip to content
Gender classifier from first name
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
model
.gitignore
LICENSE
README.md
gender.csv
index.js
package-lock.json
package.json
test.js
train_model.js
utils.js

README.md

npm Dependabot Status

Gender classifier from first name

A simple neural network that classifies the gender of first names. The current model is trained for German first names but can easily be modified for every other language.

Install

npm i name-gender-classifier

Example

const classifyName = require('name-gender-classifier');

classifyName('Andrea').then((prediction) => {
  console.log(`${prediction.name} is probably a ${prediction.male ? 'male' : 'female'} name`);
  // logs: Andrea is probably a female name
});

classifyName('Peter').then(console.log); // logs: { male: true, female: false, name: 'Peter' }
You can’t perform that action at this time.