{"id":24486995,"url":"https://github.com/taeefnajib/predict-gender-from-first-name","last_synced_at":"2026-05-20T15:06:00.226Z","repository":{"id":80054418,"uuid":"568756195","full_name":"taeefnajib/predict-gender-from-first-name","owner":"taeefnajib","description":"This project trains a model using Multinomial Naive Bayes algorithm to predict gender of a person from his/her first name. For this project, we used a dataset downloaded from data.gov which contains a zip file containing 142 txt files. There are files for every year from 1800 to 2021.","archived":false,"fork":false,"pushed_at":"2022-11-21T11:08:38.000Z","size":7140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T15:37:07.071Z","etag":null,"topics":["api","argparse","detection","fastapi","first-names","gender","gender-detection","machine-learning","multinomial-naive-bayes","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taeefnajib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-21T10:47:07.000Z","updated_at":"2022-11-21T11:13:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"7385739f-7ad9-4f25-87c2-08145fdd1995","html_url":"https://github.com/taeefnajib/predict-gender-from-first-name","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taeefnajib%2Fpredict-gender-from-first-name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taeefnajib%2Fpredict-gender-from-first-name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taeefnajib%2Fpredict-gender-from-first-name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taeefnajib%2Fpredict-gender-from-first-name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taeefnajib","download_url":"https://codeload.github.com/taeefnajib/predict-gender-from-first-name/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658263,"owners_count":20326467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","argparse","detection","fastapi","first-names","gender","gender-detection","machine-learning","multinomial-naive-bayes","python"],"created_at":"2025-01-21T15:32:22.282Z","updated_at":"2026-05-20T15:05:55.187Z","avatar_url":"https://github.com/taeefnajib.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Predict Gender from First Names\n\nThis project trains a model using `Multinomial Naive Bayes` algorithm to predict gender of a person from his/her first name. For this project, we used a dataset\ndownloaded from [data.gov](https://catalog.data.gov/dataset/baby-names-from-social-security-card-applications-national-data) which contains a zip file containing\n142 `txt` files. There are files for every year from 1800 to 2021.\n\n###**Instruction**\n\n1. Clone this repository:\n```\ngit clone https://github.com/taeefnajib/predict-gender-from-first-name\n```\n\n2. Download the zip file from [data.gov](https://catalog.data.gov/dataset/baby-names-from-social-security-card-applications-national-data) and unzip the `names` folder.\n Place it in the working directory.\n \n3. Install all the dependencies:\n```\npip install -r requirements.txt\n```\n\n4. `data.py` prepare a `csv` file from all the `txt` files and pre-processes the dataset. You don't need to run it in the command line.\n\n5. `train.py` builds a model and trains it on the dataset. The repository contains the files `data.csv` and `model.pkl`. If you remove them and run `train.py`, \nthis file will create the files `data.csv` and `model.pkl`\n\n6. `test.py` uses `argparse` to allow users to predict genders from first names in the command line. Use `--name` or `-n` followed by the name you want to predict\n gender for. Example:\n```\npython test.py --name Josh\n```\n7. If you want to use `FastAPI` instead, you can do it:\n```\nuvicorn main:app --reload\n```\nThis will open Swagger UI interface at 127.0.0.1 using port 8080 (if it is available). If you use the first name as a `string` it will reuturn a dictionary \nfor `Gender` and `Probability`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaeefnajib%2Fpredict-gender-from-first-name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaeefnajib%2Fpredict-gender-from-first-name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaeefnajib%2Fpredict-gender-from-first-name/lists"}