{"id":22732973,"url":"https://github.com/atharva-naik/vadec","last_synced_at":"2025-06-17T18:39:54.770Z","repository":{"id":67166604,"uuid":"342834935","full_name":"atharva-naik/VADEC","owner":"atharva-naik","description":"Codes and Datasets for our SIGIR 2021 Paper: \"Understanding the Role of Affect Dimensions in Detecting Emotions from Tweets: A Multi-task Approach\"","archived":false,"fork":false,"pushed_at":"2021-04-21T08:25:29.000Z","size":16156,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T01:53:45.357Z","etag":null,"topics":["coarse-grained-emotion-analysis","emotion-analysis","fine-grained-emotion-analysis","multi-task-learning","natural-language-processing","nlp","sentiment-analysis","tweets","valence-arousal-dominance"],"latest_commit_sha":null,"homepage":"","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/atharva-naik.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-27T10:58:55.000Z","updated_at":"2023-08-19T01:56:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"27f1be07-729f-4bd2-bc18-110d415cc582","html_url":"https://github.com/atharva-naik/VADEC","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/atharva-naik%2FVADEC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharva-naik%2FVADEC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharva-naik%2FVADEC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharva-naik%2FVADEC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atharva-naik","download_url":"https://codeload.github.com/atharva-naik/VADEC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809032,"owners_count":21164895,"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":["coarse-grained-emotion-analysis","emotion-analysis","fine-grained-emotion-analysis","multi-task-learning","natural-language-processing","nlp","sentiment-analysis","tweets","valence-arousal-dominance"],"created_at":"2024-12-10T20:12:28.678Z","updated_at":"2025-04-14T01:54:03.102Z","avatar_url":"https://github.com/atharva-naik.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- ### Setting up:\n\n```bash\npip install -r requirements.txt\n``` --\u003e\n\n\u003c!-- ### Preparing dataset:\n\n**add the train, val and test csv files to data/ folder** --\u003e\n\n\u003c!-- ### How to run: --\u003e\n\n# Understanding the Role of Affect Dimensions in Detecting Emotions from Tweets: A Multi-task Approach (SIGIR 2021)\n\n### Folder \"data\" :\nContains the dataset we train our model on.\n\n### Folder \"analysis_data\" :\nThis folder has COVID-19 related tweets from India, that we perform our aspect based analysis on. \nIt has two csv files, that contain predictions of our model along with cleaned tweets\n1. panacea_india_data.csv: containing all tweets from January to July 4th of 2020\n2. panacea_india_data_filt.csv: contains tweets from March 1 of 2020 to July 4th of 2020 (day number:61 to day number:186)\n\n### Folder \"aspects\" :\nIt has two subfolders:\n1. raw: it has the raw ABAE output: (7 aspects for Annoyed, Optimistic and Surprised, with 100 support words and their scores for each of the aspects)\n2. filtered: it has hand filtered output, where incoherent aspects have been discarded. The remaining aspects have been named, and a few generic, irrelevant support words have been discarded as well. This has been carried out for Annoyed and Optimistic. The final data is saved in json format \n\n### word2vec.py\nWe use this python file to get word2vec models which are required by [ABAE](https://www.comp.nus.edu.sg/~leews/publications/acl17.pdf) to generate the aspects.\n\n### normalize_tweets.py :\nWe use the function normalize tweets, for normalizing the tweets, before using word2vec.py and also to generate the \"clean_text\" field of panacea_india_data_filt.csv\n\n### For scraping/hydrating (scrape.py) :\n```bash\npython scrape.py -s True -q [queries] -l [limit on tweets]  \npython scrape.py -H True -f [files containing tweets ids]\n\nNote : The -H stands for hydration, and -s for scraping. Restrictions related to coordinates, time intervals, can be modified directly in the script.\n```\n\n\u003c!-- #### For training :\n```bash\npython train.py --exp_name (value) --encoder (value) --data_dir (value) --save_dir (value) --lr (value) --batch_size (value) --save_policy (value) --activation (value) --optim (value) --wd (value) --epochs (value) --seed (value) --use_gpu(to use gpu) --use_empath(to use empath) --l2(to use l2 reg.) --use_scheduler(to use sched) --use_dropout(to use dropout)\n``` --\u003e\n\n\u003c!-- #### For generating predictions :\n```bash\npython generate_predictions.py --gpu_id (gpu_id) --model_name (BERT/ROBERTA) --model_path (path to saved model) --output_path (path to save dir) --data (path to dir containing hydrated csv) --use_empath (y/n) --activation (tanh/bce)\n``` --\u003e\n\n### For plotting graphs (plot_graphs.ipynb) :\nIt's used to plot the counts of aspects (filtered/annoyed.json and filtered/optimistic.json) for tweets read from panacaea_data_india_filt.csv.\nWe count the number of occurences of any of the aspect categores for both emotions in chunks of tweets having 4000 tweets in them, and containing the emotion being considered (e.g. for annoyed, each tweet must have annoyed in its predictions). Ocurrence of any of the support words for an aspect of an emotion, contributes 1 to the total count. \nRun all the cells of plot_graphs.ipynb to generate the plots.\n\n\u003c!-- ### Saving scheme:\n- final_test=false, stores best validation epoch\n- final_test=true, stores test result after training on best validation hp.json --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatharva-naik%2Fvadec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatharva-naik%2Fvadec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatharva-naik%2Fvadec/lists"}