{"id":16870694,"url":"https://github.com/bung87/whatlangid","last_synced_at":"2025-04-11T10:38:20.847Z","repository":{"id":62588799,"uuid":"135431704","full_name":"bung87/whatlangid","owner":"bung87","description":"This project is build on top of whatthelang and langid","archived":false,"fork":false,"pushed_at":"2020-04-01T13:12:29.000Z","size":787,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-14T15:04:55.159Z","etag":null,"topics":["language-detection","language-identification"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bung87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-30T11:15:57.000Z","updated_at":"2023-10-10T07:58:13.000Z","dependencies_parsed_at":"2022-11-03T17:49:30.996Z","dependency_job_id":null,"html_url":"https://github.com/bung87/whatlangid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fwhatlangid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fwhatlangid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fwhatlangid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bung87%2Fwhatlangid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bung87","download_url":"https://codeload.github.com/bung87/whatlangid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248376292,"owners_count":21093673,"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":["language-detection","language-identification"],"created_at":"2024-10-13T15:05:06.469Z","updated_at":"2025-04-11T10:38:20.804Z","avatar_url":"https://github.com/bung87.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# whatlangid\n\n[![Build Status](https://travis-ci.org/bung87/whatlangid.svg?branch=master)](https://travis-ci.org/bung87/whatlangid)  [![PyPI](https://img.shields.io/pypi/v/whatlangid.svg)](https://pypi.python.org/pypi/whatlangid)\n\n\nThis project is build on top of [whatthelang](https://github.com/indix/whatthelang) and [langid](https://github.com/saffsd/langid.py)\n\n\n# Why this project exist?\n\nsee [issue_lang.py](issue_lang.py)\n\n## Dependencies\n\nThe dependencies can be installed using the requirements.txt file:\n\n```bash\n$ pip install -r requirements.txt\n```\n\n## Install\n\nfrom github  \n\n```bash\n$ pip install  git+https://github.com/bung87/whatlangid  \n```\n\nfrom pypi  \n\n```bash\n$ pip install  whatlangid  \n```\n\n\n## Basic Usage\n\nPredicting Language using ``whatlangid``\n\n```python\n\u003e\u003e\u003e from whatlangid import WhatLangId\n\u003e\u003e\u003e wtl = WhatLangId()\n\u003e\u003e\u003e wtl.predict_lang(\"Mother\")\n'en'\n\u003e\u003e\u003e wtl.predict_lang(\"தாய்\")\n'ta'\n\u003e\u003e\u003e wtl.predict_lang(\"അമ്മ\")\n'ml'\n\u003e\u003e\u003e wtl.predict_lang(\"पिता\")\n'hi'\n\u003e\u003e\u003e wtl.predict_pro([\"English sentence\", \"അമ്മ\"])\n[('en', 0.8848170638084412), ('ml', 0.9535570740699768)]\n\n```\n\nBatch Prediction is also supported\n\n```python\n\u003e\u003e\u003ewtl.predict_lang([\"അമ്മ\",\"पिता\",\"teacher\"])\n['ml','hi','en']\n```\n\n## Advanced usage\n\n`wtl = WhatLangId(custom_model=abs_path)`\n\nuse bin version model which is faster and slightly more accurate, but has a file size of 126MB\n\n`python -m whatlangid.use_bin`\n\n## Supported Languages\n\nSupports 176 languages . The ISO codes for the corresponding languages are as below.\n\n```\naf als am an ar arz as ast av az azb ba bar bcl be bg bh bn bo bpy br bs bxr ca cbk\nce ceb ckb co cs cv cy da de diq dsb dty dv el eml en eo es et eu fa fi fr frr fy ga\ngd gl gn gom gu gv he hi hif hr hsb ht hu hy ia id ie ilo io is it ja jbo jv ka kk km\nkn ko krc ku kv kw ky la lb lez li lmo lo lrc lt lv mai mg mhr min mk ml mn mr mrj ms\nmt mwl my myv mzn nah nap nds ne new nl nn no oc or os pa pam pfl pl pms pnb ps pt qu\nrm ro ru rue sa sah sc scn sco sd sh si sk sl so sq sr su sv sw ta te tg th tk tl tr\ntt tyv ug uk ur uz vec vep vi vls vo wa war wuu xal xmf yi yo yue zh\n```\n\n## Model Training Details\n\nQuantized model built using Fasttext. More details present in the fasttext [blog](https://fasttext.cc/blog/2017/10/02/blog-post.html)\n\n## Reference\n\n\n``WhatLangId`` is powered by ``FastText`` and `langid`\n\n### Enriching Word Vectors with Subword Information\n\n[1] P. Bojanowski\\*, E. Grave\\*, A. Joulin, T. Mikolov, [*Enriching Word Vectors with Subword Information*](https://arxiv.org/abs/1607.04606)\n\n```\n@article{bojanowski2016enriching,\n  title={Enriching Word Vectors with Subword Information},\n  author={Bojanowski, Piotr and Grave, Edouard and Joulin, Armand and Mikolov, Tomas},\n  journal={arXiv preprint arXiv:1607.04606},\n  year={2016}\n}\n```\n\n### Bag of Tricks for Efficient Text Classification\n\n[2] A. Joulin, E. Grave, P. Bojanowski, T. Mikolov, [*Bag of Tricks for Efficient Text Classification*](https://arxiv.org/abs/1607.01759)\n\n```\n@article{joulin2016bag,\n  title={Bag of Tricks for Efficient Text Classification},\n  author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Mikolov, Tomas},\n  journal={arXiv preprint arXiv:1607.01759},\n  year={2016}\n}\n```\n\n### FastText.zip: Compressing text classification models\n\n[3] A. Joulin, E. Grave, P. Bojanowski, M. Douze, H. Jégou, T. Mikolov, [*FastText.zip: Compressing text classification models*](https://arxiv.org/abs/1612.03651)\n\n```\n@article{joulin2016fasttext,\n  title={FastText.zip: Compressing text classification models},\n  author={Joulin, Armand and Grave, Edouard and Bojanowski, Piotr and Douze, Matthijs and J{\\'e}gou, H{\\'e}rve and Mikolov, Tomas},\n  journal={arXiv preprint arXiv:1612.03651},\n  year={2016}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbung87%2Fwhatlangid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbung87%2Fwhatlangid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbung87%2Fwhatlangid/lists"}