{"id":21212301,"url":"https://github.com/ihp-lab/mm_analysis_empathy","last_synced_at":"2025-04-13T21:50:57.899Z","repository":{"id":186207516,"uuid":"674819240","full_name":"ihp-lab/mm_analysis_empathy","owner":"ihp-lab","description":"[ICMI 23] Multimodal Analysis and Assessment of Therapist Empathy in Motivational Interviews","archived":false,"fork":false,"pushed_at":"2024-02-29T01:02:14.000Z","size":234,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T12:11:18.649Z","etag":null,"topics":["motivational-interviewing","multimodal-learning","therapist-empathy"],"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/ihp-lab.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}},"created_at":"2023-08-04T21:40:29.000Z","updated_at":"2024-10-04T23:35:00.000Z","dependencies_parsed_at":"2023-10-04T08:16:32.851Z","dependency_job_id":null,"html_url":"https://github.com/ihp-lab/mm_analysis_empathy","commit_stats":null,"previous_names":["ihp-lab/mm_analysis_empathy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihp-lab%2Fmm_analysis_empathy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihp-lab%2Fmm_analysis_empathy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihp-lab%2Fmm_analysis_empathy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihp-lab%2Fmm_analysis_empathy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ihp-lab","download_url":"https://codeload.github.com/ihp-lab/mm_analysis_empathy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788855,"owners_count":21161726,"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":["motivational-interviewing","multimodal-learning","therapist-empathy"],"created_at":"2024-11-20T21:08:45.597Z","updated_at":"2025-04-13T21:50:57.880Z","avatar_url":"https://github.com/ihp-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eMultimodal Analysis and Assessment of Therapist Empathy in Motivational Interviews\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n\n\u003ca href=\"https://ttmt001.github.io/\"\u003e\n    Trang Tran\u003c/a\u003e,\n\u003ca href=\"https://yufengyin.github.io/\"\u003e\n    Yufeng Yin\u003c/a\u003e,\n\u003ca href=\"https://www.linkedin.com/in/leili-tavabi-92649693/\"\u003e\n    Leili Tavabi\u003c/a\u003e,\n\u003ca href=\"https://profiles.ucsf.edu/joannalyn.delacruz\"\u003e\n    Joannalyn Delacruz\u003c/a\u003e,\n\u003ca href=\"https://addictionresearch.ucsf.edu/people/brian-borsari-phd\"\u003e\n    Brian Borsari\u003c/a\u003e,\n\u003ca href=\"https://woolleylab.ucsf.edu/principal-investigator\"\u003e\n    Joshua Woolley\u003c/a\u003e,\n\u003cbr\u003e\n\u003ca href=\"https://schererstefan.net/\"\u003e\n    Stefan Scherer\u003c/a\u003e,\n\u003ca href=\"https://people.ict.usc.edu/~soleymani/\"\u003e\n    Mohammad Soleymani\u003c/a\u003e\n\u003cbr\u003e\n\u003ca href=\"https://ict.usc.edu/\"\u003eUSC ICT\u003c/a\u003e, San Francisco VAHCS, UCSF Psychiatry and Behavioral Sciences\n\n\u003cstrong\u003eICMI 2023\u003c/strong\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n## Introduction\n\nThis is the official implementation of our ICMI 2023 paper: Multimodal Analysis and Assessment of Therapist Empathy in Motivational Interviews.\n\nTODO\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/ihp-lab/mm_analysis_empathy/blob/main/pipeline.png\" width=\"700px\" /\u003e\n\u003c/p\u003e\n\n## Installation\nClone repo:\n```\ngit clone https://github.com/ihp-lab/mm_analysis_empathy.git\ncd mm_analysis_empathy\n```\n\nThe code is tested with Python == 3.10, PyTorch == 1.11.0 and CUDA == 11.3 on NVIDIA Quadro RTX 8000. We recommend you to use [anaconda](https://www.anaconda.com/) to manage dependencies.\n\n```\nconda create -n mm_empathy python=3.10\nconda activate mm_empathy\nconda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch\npip install pandas\npip install -U scikit-learn\npip install transformers==4.28.1\n```\n\n## Data\nSample data can be downloaded from Google Drive: [sample data](https://drive.google.com/file/d/1PeMqm-2xohMnnlUr4M-THWi94765lot1/view?usp=drive_link). Since the clinical data is not public, we have sampled a subset in addition to replacing a random set of transcripts with random tokens. The cross-validation folds are also for sample/toy use only.\n\nDownload and untar the file, then put `sample_data` under `./mm_analysis_empathy`.\n\n## Checkpoints\nCheckpoints are available on Google Drive: [exps_independent](https://drive.google.com/drive/folders/1f0CH87HKSoCYKLfvH28nhuSSQF9O-OZE?usp=drive_link) and [exps_dependent](https://drive.google.com/drive/folders/1oqUx5y1_0V59zQ9Qsw31fD-a0dCB284-?usp=sharing).\n\nPut `./exps_independent` and `./exps_dependent` under `./mm_analysis_empathy`.\n\n## Training and Evaluation\n### General notes:\n* The json file `./sample_data/sample_data_folds.json` should be your cross-validation folds; supply the appropriate file depending on the therapist-independent vs. therapist-dependent settings.\n* Quartiles ara 0-indexed, i.e. to train/evaluate on Q2 (like in our paper), set argument `--quartile 1`. `quartile=-1` uses the full sessions.\n* The code assumes acoustic features are stored under `./sample_data/sample_features` \n\n```\nCUDA_VISIBLE_DEVICES=0 python run.py --model {text,audio,early_fusion_finetune,late_fusion_finetune} \n    --model_name {text,audio,early_fusion_finetune,late_fusion_finetune} \n    --by_speaker {therapist,both} \n    --quartile {0,1,2,3,-1} \n    --output_filename {therapist,both}-quartile-{0,1,2,3,all} \n    --epochs_num 5\n    --out_path ./exps_{dependent,independent}\n    --data_root ./sample_data\n    --data_path ./sample_data/sample_data_feats.tsv\n    --dataset_fold_path ./sample_data/sample_data_folds.json \n```\n\nFor example, this is the command to train and evaluate on the unimodal text model, using only the therapist turns from Q2, assuming `sample_data_folds.json` contains cross-validation folds for the therapist-dependent setting:\n```\nCUDA_VISIBLE_DEVICES=0 python run.py --model text --model_name text \n    --by_speaker therapist \n    --quartile 1 \n    --output_filename therapist-quartile-1 \n    --epochs_num 5\n    --out_path ./exps_dependent\n    --data_root ./sample_data\n    --data_path ./sample_data/sample_data_feats.tsv\n    --dataset_fold_path ./sample_data/sample_data_folds.json \n```\n\nGet overall f1 scores across folds\n```\npython compute_overall_scores.py --results PATH_TO_CSV_FILE\n```\ncsv files are saved under `./OUT_PATH/MODEL_NAME/OUTPUT_FILENAME`.\n\n## Citation\nTODO\n\n## Contact\nIf you have any questions, please raise an issue or email to Trang Tran (`ttran@ict.usc.edu`).\n\n## Credits\nOur codes are based on the following repositories.\n\n- [text-empathy-recognition](https://github.com/ihp-lab/empathy-recognition-acii-2023)\n- [multimodal-fusion](https://github.com/ihp-lab/XNorm)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihp-lab%2Fmm_analysis_empathy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fihp-lab%2Fmm_analysis_empathy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihp-lab%2Fmm_analysis_empathy/lists"}