Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,8 @@ dataset/sample_input_model_ER.csv
dataset/sample_test_output.csv
dataset/*-model.csv

src/divide-into-train-test-dev.py
src/divide-into-train-test-dev.py

weights/*

notebooks/*
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ A sample raw input data file is available in [dataset/sample_input_ER.csv](datas
$ python3 src/process_data.py --input_path dataset/sample_input_ER.csv --output_path dataset/sample_input_model_ER.csv
```

To process the medical dataset, run the following command to convert the .txt files from the medical data to a .csv that the model will recognize. The input should be the location of the .txt files that you downloaded (see Dataset Access Instructions for link):
```
$ python3 src/med_process_data.py --input_path local1/zsteineh/med_dataset/ --output_path local1/zsteineh/med_dataset/test_med_data.csv
```
Note, the test_med_data.csv file is already processed and available at local1/zsteineh/med_dataset/ on nlpg01. We do not provide it in GitHub as the file is too large.

### 3. Training the model
For training our model on the sample input data, run the following command:
```
Expand All @@ -48,14 +54,14 @@ $ python3 src/train.py \
```

### 4. Testing the model
For testing our model on the sample test input, run the following command:
For testing our model on the sample test input, run the following command from nlpg01, replacing sample_text_{in, out}put.csv with a file we used, such as political_tweets.csv or test_med_data.csv (input) and output_political_tweets.csv:
```
$ python3 src/test.py \
--input_path dataset/sample_test_input.csv \
--output_path dataset/sample_test_output.csv \
--ER_model_path output/sample.pth \
--IP_model_path output/sample.pth \
--EX_model_path output/sample.pth
--input_path dataset/political_tweets.csv \
--output_path dataset/political_output.csv \
--ER_model_path /local1/emazuh/output/reddit-emotion-pretrained.pth \
--IP_model_path /local1/emazuh/output/reddit-interpretation-pretrained.pth \
--EX_model_path /local1/emazuh/output/reddit-exploration-pretrained.pth
```

## Training Arguments
Expand Down Expand Up @@ -95,3 +101,21 @@ rationales: Portions of the response_post that are supporting evidences or ratio

For accessing the TalkLife portion of our dataset for non-commercial use, please contact the TalkLife team [here](mailto:research@talklife.co).

We also test the model on the medical dataset from the paper below:
```bash
@article{chen2020meddiag,
title={MedDialog: a large-scale medical dialogue dataset},
author={Chen, Shu and Ju, Zeqian and Dong, Xiangyu and Fang, Hongchao and Wang, Sicheng and Yang, Yue and Zeng, Jiaqi and Zhang, Ruisi and Zhang, Ruoyu and Zhou, Meng and Zhu, Penghui and Xie, Pengtao},
journal={arXiv preprint arXiv:2004.03329},
year={2020}
}
```
The English part of the dataset, which we used, is available at: https://drive.google.com/drive/folders/1g29ssimdZ6JzTST6Y8g6h-ogUNReBtJD?usp=sharing


## Reproduced Results

The tables below show the reproducibility results of the main points of the paper.
![Reproducibility Results of Aims 1 and 2](https://github.com/emma-mens/Empathy-Mental-Health/blob/reproducibility/table_imgs/Aim1_reproduce.png?raw=True)
![Reproducibility Results of Aim 3](https://github.com/emma-mens/Empathy-Mental-Health/blob/reproducibility/table_imgs/Aim3_reproduce.png?raw=True)

Binary file added dataset/Med_dialogue_data/label_med_data.xls
Binary file not shown.
71 changes: 71 additions & 0 deletions dataset/annotate_blind.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
id,seeker_post,response_post,ER_label_ab,IP_label_ab,EX_label_ab,,
4098,"just looked that up. first i had heard it. interesting. who knows? i mean, they know, but it__ a he said/she said at this point. regardless, it seems she waa good for those boys.","i__ not judging her, i__ just repeating what her first husband said about her. those two, are no saints and should be held to the same standards that trump is held to.",0,0,0,,
3032,"wow, one day you'll learn the truth and all your preconceived ideas on this topic will be blown away. you obviously take fox as gospel, and they've been lying to you with a vengeance for years. it's ""entertainment"" tv.","where do u get your news, cnn+msnbc? the same media that caused the covington kid and his family + friends to receive death threats? they constantly lie by omission! i hope he becomes a billionaire from suing these creeps.",0,0,2,,sarcasm
2489,"weren__ they also just complaining that he hasn__ asked putin about the assasinarion attempts on soldiers? why haven__ you talked to him about it? why? wahh! whoa, why is he meeting with putin? wahh! ______",,0,0,0,,
24,the smidge of credibility fox had left hanging before trump has been completely wiped off the face of the earth. their complacency during the trump presidency as he broke every norm and sent us spiraling as a nation renders any future coverage null and void.,and you believe the koolaid makers at msnbc and cnn?,0,0,2,,sarcasm
1438,democrats grasping for straws!,can__ see how you make america great again by destroying the united states postal service.,0,0,0,,
4715,all americans are immigrants right? so why even make this a subject of discussion?,no we__e not. that__ just a liberal talking point. the entire world is immigrants if you want to play that game. my children were all born in the usa. they are native americans as far as i__ concerned.,0,0,0,2,Sarcasm is not handled at all in model
2091,"because the has nothing.

all they can do is tear this country and its people apart.",thats why every city that is being torn apart is run by democrats right?,0,0,1,,
4528,"hey, can we rescue a dying nation first, ensure supreme court justices, and then worry about __rogress economic policies?_
cheeez! get you priorities straight!",your argument is exactly why nothing ever changes.,0,0,0,,
2374,so he didn't sleep with those students? certainly sounds like he did and is using the fact that he's gay as some sort of shield.,they weren't his students. and they were consenting adults.,0,0,0,,
1473,if this was delivered by trump you would be saying how __ark and divisive_ it was and __asts a depressing view of society_,that's a ridiculous statement. trump can't even string a sentence together.,0,0,0,,
3237,biden is literally against illegal immigration,what?,0,0,1,,
2781,so trump is admitting he only did it to make his evangelical base happy.,yes. just like his attacks in the lgbtq community he does for mike pence.,0,0,0,,
3411,can you say rudy giuliani and helping with ukraine,it's out you committed treason along w/ - all traitors,0,0,0,,
3687,obama came up with 10 tmes that to only fail!,"is the rule now? if obama steamrolled the constitution, trump is also allowed to steamroll the constitution. good to know. __",0,0,1,,
3878,disrespect is tearing up his state of the union. she really showed her ass.,"ok, karen.",0,0,0,,
3124,"blah blah blah..spying blah blah...alexa, how many deaths from covid-19 on trump__ watch today?",yea didn't you hear trump manufactured the virus and single handedly started infecting everyone.,0,0,0,,
4695,"i honestly *did* like tulsi gabbard at one point, but her running against bernie in 2020 and campaigning that hard in nh left a bad taste.

nonetheless this is a good message. idk when the healing can really begin but here's hoping it happens sooner than later.","she endorsed bernie in 2016, one of the few who did. i can't see anything unfair about simply wanting to run herself in 2020, seems her lifetime of service to her country had earned her the right to run a lot more than some folks had earned it.",0,0,0,,
1827,"sweetie, if you've ever voted before you understand that a ""fair"" vote is when a person votes in person with an i.d. if you're the least bit intelligent, you also understand that mail in ballots can get lost, changed, and discarded. so who is trying to cheat here?","darling, as i have voted many times before, i provide you some facts:",0,0,0,,
1209,"if you are not for biden, you are for trump. wether you like it or not. i love bernie but we are down to this or total collapse of our democracy. do the right thing or we will loose all respect for you!",that's not at all what this vote was about. good lord.,0,0,0,,
2868,she looks aggrieved as usual.,looks are soooo important . content means nothing to the gop. .,0,1,0,,
1380,"because this corrupt radical left party hasn't let him... this party has fought him every step of the way and when all failed you brought on fear. fear of covid

truth!",moron (or bot?),0,0,1,,
874,wake up,"how is this bad, compared to nepotism? you know? seven trademarks straight in ivanka's hands, while dad and daughter used the taxpayer's money to gain those trademarks from china? the man acts like he's about america first, but sucks at showing it.",0,0,2,,
3549,"joe biden__ time has passed, he may have been a real player in the past but today he is just physically too weak and can not take on such a huge responsibility as the president of the united states. are people blind?!",joe biden mute in a wheelchair drooling on himself would be a better president than trump....,0,0,0,,
1335,donaldvirus.,it came from china einstein,0,0,0,,
438,,your health insurance probably includes mental health care. you should look into it.,0,0,0,,
3791,"trump will literally destroy this country trying to stay in power... this will negatively impact the lives of so many people, including the majority of his base and their families",_____________________________________________crazy democrats____________________________________,0,0,0,,
2906,"did donald trump just use ""god's"" name in vain?
sad.","yes, a nudge for all the christians and evangelicals that haven't decided whether to vote for trump, or not: ""let them think i have god in my life!""",0,1,0,,
3900,bill gates gives me the creeps. his family history is creepy too.,"nobodies looking for some broad who looks like the business end of a sewer pipe,",0,0,0,,
991,hopefully she will be the ag and put the trump crime family behind bars. that would be karma and sweet justice.,".. and also a pipe dream, there is no proof to back what you say unlike biden who is under investigation along with many in the obama admin, so open your eyes to the facts which will be presented to the public via durham in due course.",0,0,0,,
3181,why not show tx and fl in red? anyone really believe biden will carry either one of them?,why should hispanics vote for trump after he abandoned them in a hurricane?,0,0,2,,
39,she said her first action as president would be to violate her oath of office and the constitution. she said she would take everyone__ guns and not wait for congress to do anything. how far left is that?,not true !!!!,1,0,0,,
2329,the real first lady,oh please!,2,0,0,,
3974,this man actually loves america unlike the criminal ripping apart our constitution.,"showing love with a pen and a phone:

phrases applicable to affirmatively furthering fair housing (affh) from obama's pen in 2015
>nationalized zoning ordinances
>federalizing suburbs
naivete' of dems and apathy of gop voters is a free america's greatest risk",0,0,0,,
869,says the king of bad marriages with a 3rd wife who probably loathes him with the fire of a 1000 suns.,you wish. be jealous. they love each other very much.,0,0,0,,
2640,_____________________________________________________________________________________________________________________________________________________________________,"so eloquent, priscilla.",0,0,0,,
78,who will you delegate this assignment to? __,mnuchin,0,0,0,,
3125,"and right about now, melania was plagiarizing michelle's speech.",that's the best you got?,0,0,2,,
2044,she's self-made ... not a bankrupt heir like trump,when you own a tower in nyc let us know cuz we all wanna stay on your dime as is the socialist way,0,0,1,,
251,why isn't her husband saying this?,teleprompter not working..,0,0,0,,
1595,"my power has been taken by overzealous democrats calling my house arrest and mask mandates during covid. democrat cities are under siege by far left fringe groups looting, destroying and sometimes killing. i'm voting to end this destruction and those who fuel it, democrats.","funny, it all happened under trump__ lack of leadership. countries with more competent leadeship are reopening. now, businesses trying to survive with online business, have a mail system that has failed them. donnie destroys everything.",1,0,0,,
4376,"america has ramped up testing more than any other country in the world. free markets are chaotic and messy sometimes, something bill gates didn't have to deal with when he had monopoly power.","no, american has not. when tests are unavailable in hotspots and results take days, they are useless for contact tracing and controlling the virus. the evidence is clear",0,0,0,,
1091,"michelle obama gave one of the most devastating, but graceful speeches of all time. she is incredible. donald trump's time is up.","__ne of the most_

not sure about that. but it did confirm you bias.",0,1,0,,
1074,since may? all fine now. nice headline. media sucks.,"it__ a related syndrome, aftereffects of covid. not covid itself. reading comprehension is helpful.",0,1,0,,
3266,"john kerry was against our vietnam vets and was for the viet-cong.
he has always been against america.
trump is for america!",donkey trump is taking millions of dollars away from veterans by bankrupting the usps! vote joe biden! his son went to war! trumps kids have only seen their mothers in court waring with their father!,0,0,0,,
989,his marriages were bad before the lock downs.,a person born when his first marriage went south is old enough to run for president.,0,0,0,,
3310,"oh yes the diverse town of long branch, with 30,000 people. lol he is so weak he can__ travel to places with a large pop cause he knows he will be booed","that__ exactly why he didn__ make a fuss about throwing out the first pitch for any baseball games , his ego couldn__ take the reality of people boo__ng him",0,1,0,,
4275,,is this a serious comment by a real person?,0,0,2,,
1940,"new zealand with zero covid cases delays election.
usa with millions of cases, keeps election on schedule..",nz is currently experiencing a small outbreak which is troubling because they don't know how it got in this time,0,1,0,,
2457,"the fringe-right crowd's reputation and credibility have been severely damage due to their constant propagation of deliberately misleading narratives and falsehoods in social media and so-called news outlets.

the american people knows better not to believe the maga crowd.",riiiight.,0,0,0,,
4607,wrong.,thats not the actual bill lmfao ... compare both bills side by side and then come talk to me ..,1,0,1,,
Loading