{"id":16165927,"url":"https://github.com/bluzukk/appraisal-emotion-classification","last_synced_at":"2025-06-13T19:06:07.496Z","repository":{"id":79726234,"uuid":"269360479","full_name":"bluzukk/appraisal-emotion-classification","owner":"bluzukk","description":"Appraisal-based Emotion Classification in Text","archived":false,"fork":false,"pushed_at":"2020-10-07T16:46:55.000Z","size":19017,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T20:05:48.627Z","etag":null,"topics":["emotion-classification"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluzukk.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":"2020-06-04T12:59:46.000Z","updated_at":"2024-10-07T10:05:48.000Z","dependencies_parsed_at":"2023-02-27T21:16:35.130Z","dependency_job_id":null,"html_url":"https://github.com/bluzukk/appraisal-emotion-classification","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bluzukk/appraisal-emotion-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzukk%2Fappraisal-emotion-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzukk%2Fappraisal-emotion-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzukk%2Fappraisal-emotion-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzukk%2Fappraisal-emotion-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluzukk","download_url":"https://codeload.github.com/bluzukk/appraisal-emotion-classification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzukk%2Fappraisal-emotion-classification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259704409,"owners_count":22898858,"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":["emotion-classification"],"created_at":"2024-10-10T02:52:22.899Z","updated_at":"2025-06-13T19:06:07.469Z","avatar_url":"https://github.com/bluzukk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository contains the Appraisal enISEAR dataset: A reannotation of the enISEAR corpus with Cognitive Appraisal.\nFurther, this repository contains python code that was used for the experiments in the paper \n*[Appraisal Theories for Emotion Classification in Text](https://arxiv.org/abs/2003.14155).*  \n\n\n\n*Jan Hofmann, Enrica Troiano, Kai Sassenberg, and Roman Klinger. \nAppraisal theories for emotion classification in text. \nIn Proceedings of the 28th International Conference on Computational Linguistics, 2020. \n[ [bib](https://www.romanklinger.de/publications/2020_bib.html#Hofmann2020b) | [http](https://arxiv.org/abs/2003.14155)]*\n\n\nIn addition, this repository provides scripts to reproduce the results of the models reported in the paper. \nFor more information about the Appraisal enISEAR dataset see the [Corpora Overview](corpora).\n\n\u003cbr\u003e\n\n- [Requirements](#requirements)\n  * [Installation using Anaconda](#installation-using-anaconda)\n  * [Manual Installation](#manual-installation)\n- [Reproducing Results on enISEAR](#reproducing-results-on-enisear)\n  * [Baseline Results](#baseline-results)\n  * [Appraisal predictions based on Text](#appraisal-predictions-based-on-text)\n  * [Emotion predictions based on Appraisals](#emotion-predictions-based-on-appraisals)\n  * [Pipeline Experiment](#pipeline-experiment)\n  * [Multi-task and Oracle Experiment](#multi-task-and-oracle-experiment)\n- [Annotating unlabeled Text Instances with Appraisals](#annotating-unlabeled-text-instances-with-appraisals)\n\n# Requirements\n\n## Installation using Anaconda\n1. Install [Anaconda](https://docs.anaconda.com/anaconda/install/)\n2. Install Tensorflow environment\n\n  ```\n  conda create -n tf tensorflow=1.14  # (CPU-Version)\n  ```\n\n  ```\n  conda create -n tf tensorflow-gpu=1.14 # (GPU-Version)\n  ```\n\n3. Activate Tensorflow environment and install futher dependencies\n\n  ```\n  conda activate tf;\n  pip3 install numpy==1.16.4 pandas sklearn keras==2.3.0 gensim;\n  ```\n\n## Manual Installation\n\n#### CPU Only\n* Python 3.5+\n* Install dependencies:\n```\npip3 install --user numpy==1.16.4 pandas sklearn keras==2.3.0 gensim tensorflow==1.14\n```\n\n#### GPU Support (nvidia)\n* Python 3.5 or 3.6\n* Install dependencies:\n```\npip3 install --user numpy==1.16.4 pandas sklearn keras==2.3.0 gensim tensorflow-gpu==1.14\n```\n\n* Install [cuda](https://developer.nvidia.com/cuda-downloads 'https://developer.nvidia.com/cuda-downloads') (Testet with cuda 10.0.130)\n* Install [cuDNN](https://developer.nvidia.com/cudnn 'https://developer.nvidia.com/cudnn') (Tested with cudnn 7.6.5.32-2)\n\nThis configuration was tested on linux with python 3.8.1 for CPU and python 3.5.9 for GPU support.\n\n\n# Reproducing Results on 'Appraisal enISEAR'\n\n## Baseline Results\nTo start the baseline models on the enISEAR dataset navigate to the baseline directory with `cd impl-z-baseline;` then run\n```bash\npython3 baseline_CNN.py --dataset enISEAR\n```\n```bash\npython3 baseline_MaxEnt.py --dataset enISEAR\n```\n\n## Appraisal predictions based on Text\nIn order to reproduce the ''appraisal prediction from text'' experiment navigate to the ''main experiment'' directory with `cd impl-main-experiments;`. Then run\n```bash\npython3 a_appraisals_from_text.py --dataset enISEAR_V1\n```\n\nTo run the model on the *automated annotations* run\n```bash\npython3 a_appraisals_from_text.py --dataset enISEAR_V3\n```\n\n## Emotion predictions based on Appraisals\nIn order to predict emotions from appraisals navigate to the ''main experiment'' directory with `cd impl-main-experiments;`. Then run\n```bash\npython3 b_emotions_from_appraisals.py --dataset enISEAR_V1\n```\n\n## Pipeline Experiment\nIn order to reproduce the ''appraisal-emotion-pipeline'' experiment navigate to the ''main experiment'' directory with `cd impl-main-experiments;`. Then run\n```bash\npython3 c_pipeline.py --dataset enISEAR_V1\n```\n\n## Multi-task and Oracle Experiment\nIn order to reproduce the multi-task experiment navigate to the additional experiments directory with `cd impl-x-additional-experiments;`. Then run\n```bash\npython3 multi_task_fully_shared.py --dataset enISEAR_V1\n```\nor\n```bash\npython3 oracle_CNN_saveModels.py --dataset enISEAR_V1 --rounds 1\n```\n\n# Annotating unlabeled Text Instances with Appraisals\nThe scripts can be used to predict appraisals on text instances with no emotions labels.  \nTo do this first navigate to the ''main experiment'' directory with `cd impl-main-experiments;`  \nThen run the `b_appraisals_from_text.py` script with the `--annotate` option:\n\n```bash\npython3 b_appraisals_from_text.py -d enISEAR_V1 --annotate \u003cTextInstances\u003e.csv\n```\n\n\u003cbr\u003e\n\nYou can also skip training to predict appraisals by using the pre-trained model, which was\ntrained to predict appraisals on 'appraisal enISEAR'  \nTo annotate your text instances using the pre-trained model run:\n\n```bash\npython3 b_appraisals_from_text.py -d enISEAR_V1 --annotate \u003cTextInstances\u003e.csv --loadmodel ../pre-trained/enISEAR_V1_appraisal_predictor.h5\n```\n\n\u003cbr\u003e\nYour dataset annotated with predicted appraisals will be saved to 'TextInstances_appraisals.csv'  \n\u003cbr\u003e\nNote that your dataset musst be formatted as follows:\n\n```\nSentence\n\u003cText Instance 1\u003e\n\u003cText Instance 2\u003e\n\u003cText Instance 3\u003e\n.\n.\n.\n```\nThis means the first line in the file musst be 'Sentence' followed by your text instances (one in every line).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluzukk%2Fappraisal-emotion-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluzukk%2Fappraisal-emotion-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluzukk%2Fappraisal-emotion-classification/lists"}