{ "info": { "author": "Hsin-Min Lu, Yu-Lun Li, Chi-Yu Lin", "author_email": "luim@ntu.edu.tw", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "namesex_light\n-------------\n\nNamesex_light is a lighweight package that predicts the gender tendency of Chinese given names. This module comes with a L2 regularized logistic regression trained on 10,730 Chinese given names (in traditional Chinese) with reliable gender lables collected from public data. The predict() function takes a list of names and output predicted gender tendency (1 for male and 0 for female) or probability of being a male name. Namesex_light has a sister project, namesex, that performs similar tasks with higher accuracy.\n\nAdditional information about namesex and namesex_light can be found `in another document (in Chinese) `_.\n\nThe prediction performance evaluated by ten-fold cross validation is:\n\n========= =========== =====================\nMetric Performance Performance Std. Dev.\n--------- ----------- ---------------------\nAccuracy 0.8957 0.007327\nF1 0.8920 0.007873\nPrecision 0.8852 0.012238\nRecall 0.8991 0.008936\nLogloss 114.35 6.413972\n========= =========== =====================\n\n\nUse pip/pip3 to install namesex_light.::\n\n pip install namesex_light\n\nTo use namesex_light, pass in an array or list of given names to predict(). For each element in the input list, predict() returns 1 or 0 for male or female prediction. Set \"predprob = True\" to return probability of being a male name. The following is a simple sample code.::\n\n\n >>> import namesex_light\n >>> nsl = namesex_light.namesex_light()\n >>> nsl.predict(['\u6c11\u8c6a', '\u611b\u9e97', '\u5fd7\u660e'])\n array([1, 0, 1])\n >>> nsl.predict(['\u6c11\u8c6a', '\u611b\u9e97', '\u5fd7\u660e'], predprob=True)\n array([0.99968932, 0.00530066, 0.9938986 ])\n\nNote that namesex_light was trained using Chinese given names only. However, it may be used to classifier translated names as well::\n\n >>> nsl.predict(['\u963f\u6ce2\u7f85', '\u963f\u6ce2\u7f85', '\u96f7', '\u827e\u7f8e', '\u5e03\u862d\u59ae', '\u963f\u66fc\u9054'])\n array([1, 1, 1, 0, 0, 1])\n\nThis module is intended for a quick plug-and-play. The original training dataset is not included.\n\nTesting Dataset\n---------------\n\nThis package comes with a small testing dataset that was not used for model training. The following sample code illustrate a simple usage.::\n\n >>> testdata = namesex_light.testdata()\n >>> nsl = namesex_light.namesex_light()\n >>> pred = nsl.predict(testdata.gname)\n >>> print(\"The first 5 given names are: {}\".format(testdata.gname[0:5]))\n The first 5 given names are: ['\u7fca\u5982', '\u59a4\u5ead', '\u8ac6\u748b', '\u5927\u958e', '\u548c\u7dad']\n >>> print(\" and their sex: {}\".format(testdata.sex[0:5]))\n and their sex: [0, 0, 1, 1, 1]\n >>> print(\" and their predicted sex:{}\".format(pred[0:5]))\n and their predicted sex:[0 0 1 1 1]\n >>> accuracy = np.sum(pred == testdata.sex) / len(pred)\n >>> print(\" Prediction accuracy = {}\".format(accuracy))\n Prediction accuracy = 0.8627450980392157\n\nNote that the accuracy is slightly lower compared to the accuracy of ten-fold cross valudation. I guess this is normal since this testset is collected from a source that is different from the training dataset.\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hsinmin/namesex_light", "keywords": "classify_sex Chinese_given_name", "license": "", "maintainer": "", "maintainer_email": "", "name": "namesex-light", "package_url": "https://pypi.org/project/namesex-light/", "platform": "", "project_url": "https://pypi.org/project/namesex-light/", "project_urls": { "Homepage": "https://github.com/hsinmin/namesex_light" }, "release_url": "https://pypi.org/project/namesex-light/0.2.1/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "A lightweight gender classifier for Chinese given names", "version": "0.2.1" }, "last_serial": 4049638, "releases": { "0.1.6": [ { "comment_text": "", "digests": { "md5": "9c0efc8732fed88d8a2dfd6837871474", "sha256": "e3f03c0bcbc462999137f76280affb9db307a69f809f693af64ee7613e275d4b" }, "downloads": -1, "filename": "namesex_light-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "9c0efc8732fed88d8a2dfd6837871474", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 69120, "upload_time": "2018-07-09T04:47:19", "url": "https://files.pythonhosted.org/packages/91/18/162d8a6681c264bcfb5d84c42d399155c902f7ee63a0adc195aa1595d55a/namesex_light-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3363c076671eda5333fb6a46ad2763df", "sha256": "7b929a987a95f3eb097ed257ee53fb6932239bc6a7a2e4982ce4a0b0296ea931" }, "downloads": -1, "filename": "namesex_light-0.1.6.tar.gz", "has_sig": false, "md5_digest": "3363c076671eda5333fb6a46ad2763df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4559, "upload_time": "2018-07-09T04:47:21", "url": "https://files.pythonhosted.org/packages/d5/25/3600777ebb5f91a43c74fa1b9353da665f8d337ef19d2ef9650ebe7b5aaa/namesex_light-0.1.6.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "eee9ce9873e6a9aeece686ada21b34be", "sha256": "6c7aabe058bb50ccf6532b60d1f4b81f795336f51f1c20b9cb56c64335c17c57" }, "downloads": -1, "filename": "namesex_light-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "eee9ce9873e6a9aeece686ada21b34be", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 69408, "upload_time": "2018-07-11T04:43:35", "url": "https://files.pythonhosted.org/packages/ca/72/ce35c646226e268dfe1f629c83a062d140b5c602de10091acf6db4003a37/namesex_light-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "544bfd6b709f42b1cac37972b592ee0e", "sha256": "93bb8565fb0fbd0a3d8837608d13fc1a3cb338d48108b2e95703250b598b64a1" }, "downloads": -1, "filename": "namesex_light-0.2.0.tar.gz", "has_sig": false, "md5_digest": "544bfd6b709f42b1cac37972b592ee0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4722, "upload_time": "2018-07-11T04:43:36", "url": "https://files.pythonhosted.org/packages/57/1b/b85f8f1fd476bd39c01164e18ecbb5d79efcaa75412fc0ca5ec8154b6bb8/namesex_light-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "53a701708d79da924731d968fbf96e37", "sha256": "e426353bb0ed48cbf990a72ebaf16b69403fa7e4dbb6528d5912a77cd9c2f49c" }, "downloads": -1, "filename": "namesex_light-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "53a701708d79da924731d968fbf96e37", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 69449, "upload_time": "2018-07-11T04:46:01", "url": "https://files.pythonhosted.org/packages/22/da/3a02cc2b5c629fff8c18f23922168c5e7c0385a58e31f28b8f9abb78f15a/namesex_light-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "abf97d1b0cc85ac2f1906a06dbe4de49", "sha256": "338b8142e0500270a324e63a7f42b615913def257246f8328da3fcc8eea2f5ea" }, "downloads": -1, "filename": "namesex_light-0.2.1.tar.gz", "has_sig": false, "md5_digest": "abf97d1b0cc85ac2f1906a06dbe4de49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4724, "upload_time": "2018-07-11T04:46:03", "url": "https://files.pythonhosted.org/packages/6f/d2/472d16e588449fa1cae698fb7f420347b5865420695a8a1980959bcc27c6/namesex_light-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "53a701708d79da924731d968fbf96e37", "sha256": "e426353bb0ed48cbf990a72ebaf16b69403fa7e4dbb6528d5912a77cd9c2f49c" }, "downloads": -1, "filename": "namesex_light-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "53a701708d79da924731d968fbf96e37", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 69449, "upload_time": "2018-07-11T04:46:01", "url": "https://files.pythonhosted.org/packages/22/da/3a02cc2b5c629fff8c18f23922168c5e7c0385a58e31f28b8f9abb78f15a/namesex_light-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "abf97d1b0cc85ac2f1906a06dbe4de49", "sha256": "338b8142e0500270a324e63a7f42b615913def257246f8328da3fcc8eea2f5ea" }, "downloads": -1, "filename": "namesex_light-0.2.1.tar.gz", "has_sig": false, "md5_digest": "abf97d1b0cc85ac2f1906a06dbe4de49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4724, "upload_time": "2018-07-11T04:46:03", "url": "https://files.pythonhosted.org/packages/6f/d2/472d16e588449fa1cae698fb7f420347b5865420695a8a1980959bcc27c6/namesex_light-0.2.1.tar.gz" } ] }