{"id":22458871,"url":"https://github.com/s1998/progressivetraincodeswitch","last_synced_at":"2026-07-14T10:18:22.922Z","repository":{"id":67610933,"uuid":"496094697","full_name":"s1998/progressiveTrainCodeSwitch","owner":"s1998","description":"Code for the Findings of EMNLP 2022 paper \"Progressive Sentiment Analysis for Code-Switched Text Data\"","archived":false,"fork":false,"pushed_at":"2022-12-06T08:10:25.000Z","size":5468,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T18:27:25.455Z","etag":null,"topics":[],"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/s1998.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-05-25T05:29:52.000Z","updated_at":"2022-12-21T04:26:30.000Z","dependencies_parsed_at":"2023-05-23T18:45:16.446Z","dependency_job_id":null,"html_url":"https://github.com/s1998/progressiveTrainCodeSwitch","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/s1998%2FprogressiveTrainCodeSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1998%2FprogressiveTrainCodeSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1998%2FprogressiveTrainCodeSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s1998%2FprogressiveTrainCodeSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s1998","download_url":"https://codeload.github.com/s1998/progressiveTrainCodeSwitch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245858881,"owners_count":20684062,"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":[],"created_at":"2024-12-06T08:42:05.115Z","updated_at":"2025-10-28T15:04:27.832Z","avatar_url":"https://github.com/s1998.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Progressive Sentiment Analysis for Code-Switched Text Data\n\n- [Model](#model)\n- [Training](#training)\n\t- [Required Inputs](#required-inputs)\n\t- [Commands](#commands)\n\t- [Requirements](#requirements)\n- [Citation](#citation)\n\n### Model\n\nMost of the experiments have been carried out using ```bert-base-multilingual-cased``` as the backbone model. \n\nThe framework is present in the file ``` models/ds_model.py ```.\n\n\u003c!-- ## Training --\u003e\n\n### Required inputs\n\nExternal english data for pretraining should be present in the ```data/english_data``` file.\n\nFor code-switched datasets, create a folder with the dataset name and create ```train.txt``` and ```validation.txt```.\n\nFor example, for the ```sail``` dataset used in ```GLUECoS```, files should be ```data/sail/train.txt``` and ```data/sail/validation.txt```.\n\nEach row should contain the text and the label (i.e. positive or negative). The words in Hindi/Tamil should be transliterated to devanagari script.\n\nYou can obtain the Hindi-English (sail) or Spanish-English (enes) dataset from [here](https://github.com/microsoft/GLUECoS) and put it in the data folder.  Tamil-English (taen) dataset can be downloaded from [here](https://dravidian-codemix.github.io/2020/datasets.html) . \n\n### Commands\n\nThe ```main_ds.py``` can take following arguments: \n- ```arg_data``` to denote the dataset, currently takes ```sail``` , ```enes``` or ```taen``` as input.\n- ```external_data_imbalance_fix``` to deal with imbalance in the source dataset used for pretraining.\n- ```seed``` to fix the seed scross experiments\n- ```zsl_ds_us_data_merged_multiple_m_half_data``` or ```zsl_ds_us_data_merged_multiple_m_half_data_many_runs``` or ```supervised``` to do single run or multiple runs or supervised run.\n\nExample commands to run:\n\n```\npython main_ds.py --external_data_imbalance_fix upsample  --seed 22 --zsl_ds_us_data_merged_multiple_m_half_data_many_runs --arg_data sail \u003e logs/sail_half_data_hrd_lbl_merged_bkts_ds_us_run22 \u0026\n\npython main_ds.py --external_data_imbalance_fix upsample  --seed 22 --zsl_ds_us_data_merged_multiple_m_half_data_many_runs --arg_data taen \u003e logs/taen_half_data_hrd_lbl_merged_bkts_ds_us_run22 \u0026\n\npython main_ds.py --external_data_imbalance_fix upsample  --seed 22 --zsl_ds_us_data_merged_multiple_m_half_data_many_runs --arg_data enes \u003e logs/enes_half_data_hrd_lbl_merged_bkts_ds_us_run22 \u0026\n```\n\n### Requirements\n\nThis project is based on ```python==3.6.10```. The dependencies are as follow:\n```\ntorch==1.9.1\nargparse\ntransformers==3.5.1\nnltk==3.5\nsklearn\nai4bharat==0.5.0.3\n```\n\n### Citation \n\n```\n@misc{https://doi.org/10.48550/arxiv.2210.14380,\n  doi = {10.48550/ARXIV.2210.14380},\n  url = {https://arxiv.org/abs/2210.14380},\n  author = {Ranjan, Sudhanshu and Mekala, Dheeraj and Shang, Jingbo},\n  keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},\n  title = {Progressive Sentiment Analysis for Code-Switched Text Data},\n  publisher = {arXiv},  \n  year = {2022},\n  copyright = {arXiv.org perpetual, non-exclusive license}\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs1998%2Fprogressivetraincodeswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs1998%2Fprogressivetraincodeswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs1998%2Fprogressivetraincodeswitch/lists"}