{"id":23691099,"url":"https://github.com/sagorbrur/codeswitch","last_synced_at":"2025-09-02T20:31:43.083Z","repository":{"id":50304472,"uuid":"289439286","full_name":"sagorbrur/codeswitch","owner":"sagorbrur","description":"CodeSwitch is a NLP tool, can use for language identification, pos tagging, name entity recognition, sentiment analysis of code mixed data.","archived":false,"fork":false,"pushed_at":"2020-11-02T12:55:48.000Z","size":24,"stargazers_count":35,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-28T21:51:12.493Z","etag":null,"topics":["code-mixed","code-switching","codeswitch","hindi-english","huggingface","language-identification","ner","nlp","pos","pos-tagging","sentiment-analysis","spanish-english","transformers"],"latest_commit_sha":null,"homepage":"https://codeswitch.readthedocs.io","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagorbrur.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":"2020-08-22T07:12:26.000Z","updated_at":"2025-04-08T05:40:03.000Z","dependencies_parsed_at":"2022-09-12T22:20:37.516Z","dependency_job_id":null,"html_url":"https://github.com/sagorbrur/codeswitch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sagorbrur/codeswitch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2Fcodeswitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2Fcodeswitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2Fcodeswitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2Fcodeswitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagorbrur","download_url":"https://codeload.github.com/sagorbrur/codeswitch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagorbrur%2Fcodeswitch/sbom","scorecard":{"id":795184,"data":{"date":"2025-08-11","repo":{"name":"github.com/sagorbrur/codeswitch","commit":"15e82db3c5a88a2976ae12b3445d28681767d121"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":1,"reason":"0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2023-299 / GHSA-282v-666c-3fvg","Warn: Project is vulnerable to: GHSA-37mw-44qp-f5jm","Warn: Project is vulnerable to: GHSA-37q5-v5qm-c9v8","Warn: Project is vulnerable to: PYSEC-2023-300 / GHSA-3863-2447-669p","Warn: Project is vulnerable to: GHSA-6rvg-6v2m-4j46","Warn: Project is vulnerable to: GHSA-9356-575x-2w9m","Warn: Project is vulnerable to: GHSA-fpwr-67px-3qhx","Warn: Project is vulnerable to: PYSEC-2024-229 / GHSA-hxxf-235m-72v3","Warn: Project is vulnerable to: GHSA-jjph-296x-mrcr","Warn: Project is vulnerable to: GHSA-phhr-52qp-3mj4","Warn: Project is vulnerable to: GHSA-q2wp-rjmx-x6x9","Warn: Project is vulnerable to: PYSEC-2025-40 / GHSA-qq3j-4f4f-9583","Warn: Project is vulnerable to: PYSEC-2024-227 / GHSA-qxrp-vhvm-j765","Warn: Project is vulnerable to: PYSEC-2023-301 / GHSA-v68g-wm8c-6x7j","Warn: Project is vulnerable to: PYSEC-2024-228 / GHSA-wrfc-pvp9-mr9g"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T08:44:35.889Z","repository_id":50304472,"created_at":"2025-08-23T08:44:35.889Z","updated_at":"2025-08-23T08:44:35.889Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272816498,"owners_count":24997789,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["code-mixed","code-switching","codeswitch","hindi-english","huggingface","language-identification","ner","nlp","pos","pos-tagging","sentiment-analysis","spanish-english","transformers"],"created_at":"2024-12-30T02:54:42.178Z","updated_at":"2025-09-02T20:31:42.819Z","avatar_url":"https://github.com/sagorbrur.png","language":"Jupyter Notebook","readme":"# Code Switch\n[![Documentation Status](https://readthedocs.org/projects/codeswitch/badge/?version=latest)](https://codeswitch.readthedocs.io/en/latest/?badge=latest)\n[![PyPI Version](https://img.shields.io/pypi/v/codeswitch)](https://pypi.org/project/codeswitch/)\n[![Colab Notebook](https://img.shields.io/badge/notebook-colab%20notebook-orange)](https://github.com/sagorbrur/codeswitch/blob/master/notebook/codeswitch.ipynb)\n[![Downloads](https://pepy.tech/badge/codeswitch)](https://pepy.tech/project/codeswitch)\n\n**CodeSwitch** is an NLP tool, can use for language identification, pos tagging, name entity recognition, sentiment analysis of code mixed data.\n\n## Supported Code-Mixed Language\nWe used [LinCE](https://ritual.uh.edu/lince/home) dataset for training **multilingual BERT** model using huggingface [transformers](https://github.com/huggingface/transformers). `LinCE` has four language mixed data. We took three of it `spanish-english`, `hindi-english` and `nepali-english`. Hope we will train and add other language and task too.\n\n* Spanish-English(spa-eng)\n* Hindi-English(hin-eng)\n* Nepali-English(nep-eng)\n\n### Language Code\n* `spa-eng` for spanish-english\n* `hin-eng` for hindi-english\n* `nep-eng` for nepali-english\n\n## Installation\n```\npip install codeswitch\n```\n## Dependency\n* pytorch \u003e=1.6.0\n\n## Training Details\n* All three(lid, ner, pos) sequence tagging model was trainend with huggingface [token classification](https://github.com/huggingface/transformers/tree/master/examples/token-classification)\n* Sentiment Analysis Model trained with huggingface [text classification](https://github.com/huggingface/transformers/tree/master/examples/text-classification)\n* You can find every model and evaluation results [here](https://huggingface.co/sagorsarker)\n\n## Features \u0026 Supported Language\n* Language Identification\n  - spanish-english\n  - hindi-english\n  - nepali-english\n* POS\n  - spanish-english\n  - hindi-english\n* NER\n  - spanish-english\n  - hindi-english\n* Sentiment Analysis\n  - spanish-english\n\n## Language Identification\n\n```py\nfrom codeswitch.codeswitch import LanguageIdentification\nlid = LanguageIdentification('spa-eng') \n# for hindi-english use 'hin-eng', \n# for nepali-english use 'nep-eng'\ntext = \"\" # your code-mixed sentence \nresult = lid.identify(text)\nprint(result)\n```\n\n## POS Tagging\n```py\nfrom codeswitch.codeswitch import POS\npos = POS('spa-eng')\n# for hindi-english use 'hin-eng'\ntext = \"\" # your mixed sentence \nresult = pos.tag(text)\nprint(result)\n\n```\n\n\n## NER Tagging\n```py\nfrom codeswitch.codeswitch import NER\nner = NER('spa-eng')\n# for hindi-english use 'hin-eng'\ntext = \"\" # your mixed sentence \nresult = ner.tag(text)\nprint(result)\n\n```\n\n## Sentiment Analysis\n\n```py\nfrom codeswitch.codeswitch import SentimentAnalysis\nsa = SentimentAnalysis('spa-eng')\nsentence = \"El perro le ladraba a La Gatita .. .. lol #teamlagatita en las playas de Key Biscayne este Memorial day\"\nresult = sa.analyze(sentence)\nprint(result)\n# [{'label': 'LABEL_1', 'score': 0.9587041735649109}]\n\n\n```\n\n## Acknowledgement\n* [LinCE](https://ritual.uh.edu/lince/home)\n* [BERT](https://arxiv.org/abs/1810.04805)\n* [huggingface](https://github.com/huggingface)\n\n\n\n\n","funding_links":[],"categories":["\u003ca name='Libraries'\u003e\u003c/a\u003eLibraries and Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagorbrur%2Fcodeswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagorbrur%2Fcodeswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagorbrur%2Fcodeswitch/lists"}