publichealthsurveillance commited on
Commit
c8fd986
1 Parent(s): 8000720

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -10
app.py CHANGED
@@ -6,14 +6,14 @@ vs_examples = [
6
  ["In child protective services, further providing for definitions, for immunity from liability"],
7
  ["Lol what? Measles is a real thing. Get vaccinated"]]
8
  vs_title = "Vaccine Sentiment Task"
9
- vs_desc = "Enter vaccine-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The three provided examples have true labels 'vaccine critical', 'neutral', 'vaccine supportive' respectively (NOTE: you may have to click submit again to generate the correct labels). For more details, please refer to the VS2 dataset description in our paper (link provided in the corresponding Hugging Face repository)."
10
 
11
  hm_examples = [
12
  ["Serious as a heart attack question/thought Riddle me this. Why, oh why, does cold brew coffee get warm after sitting to long. Taste terrible. And Hot coffee get literally COLD after sitting too long. Tastes terrible. Like what. Why don't cold stay cold and hot only get warm?"],
13
  # ["It's odd how humans are considered predators when they have a heart attack and run like mad when a small insect is running straight towards them."],
14
  ["The older we get the less likely we are to view a sudden massive heart attack as a tragedy than a stroke of good luck."]]
15
  hm_title = "Health Mention Task"
16
- hm_desc = "Enter health-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The two provided examples have true labels 'Figurative/Hyperbolic Health Mentions', 'TODO:Health mentions' respectively (NOTE: you may have to click submit again to generate the correct labels). For more details, please refer to the RHMD dataset description in our paper (link provided in the corresponding Hugging Face repository)."
17
 
18
  dep_examples = [
19
  ["Nothing major, some underage drinking, a little pot, but I wasn't a bad kid. Furthermore, I feel like I matured well and have gone on to be successful for my age (24) IMO. I've also had positive experiences with police. The resource officer at my high school was a really good guy and almost like a mentor to me. When I was 17 I was arrested when police raided a friends house because they were tipped off that there was to be some under-aged drinking. Furthermore, I told him before we got really serious that I have anxiety and depression, and if he can’t handle that then I’ll understand if we end things. But *he* chose to stay with me and help me if I wanted it. Honestly I’m just tired of defending myself to him after this fight. I shouldn’t have to. And he kept threatening to break up; then why don’t you do it?"],
@@ -29,7 +29,7 @@ covid_examples = [
29
  ["The latest Boarding Pass! #budget2020 #coronavirus"]
30
  ]
31
  covid_title = "COVID Related Task"
32
- covid_desc = "Enter covid-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The two provided examples have true labels 'news', 'personal narrative' respectively (NOTE: you may have to click submit again to generate the correct labels). For more details, please refer to the Covid category dataset description in our paper (link provided in the corresponding Hugging Face repository)."
33
 
34
  # 2nd example looks like the most risk
35
  suicide_examples = [
@@ -46,14 +46,14 @@ stress_examples = [
46
  ["My daughter's father I was with for 5 years on and off. He was not abusive the first year, however when he became so I left and found out two weeks later I was pregnant. Of course he begged and pleaded for a second chance, and I believed that my daughter deserved me to at least give it a shot. I came back and surprise surprise it was worse than it ever was. I stuck it out until he disappeared for the eleventeenth time on a drunken bender, I checked my Facebook to find some scumbag girl who was dating one of his best friends was posting horrific, nasty, way out shit about me."]
47
  ]
48
  stress_title = "Stress Task"
49
- stress_desc = "Enter Reddit posts to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The provided example has a true label of 'stress' (NOTE: you may have to click submit again to generate the correct label). For more details, please refer to the Dreaddit dataset description in our paper (link provided in the corresponding Hugging Face repository)."
50
 
51
  other_examples = [
52
  ["@anxietyfighter suffered social anxiety for 4 yrs when i had my first panic attack,got worse when i went to uni, so have just started paxil"],
53
  ["@JessBarrett227 Taking someone off 150mg off Seroquel, mixing it with Olanzapine in 2 wks causes psychosis - a proper assess was not done. "]
54
  ]
55
  other_title = "Other Health Related Task"
56
- other_desc = "Enter drug-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The two provided examples have true labels 'no adverse drug reaction', 'adverse drug reaction' respectively (NOTE: you may have to click submit again to generate the correct labels). For more details, please refer to the SMM4H T1 dataset description in our paper (link provided in the corresponding Hugging Face repository)."
57
 
58
  # def make_interfaces(folder):
59
  # predictor_bert = ktrain.load_predictor(folder + "bert")
@@ -106,7 +106,8 @@ vs_phs_io = Interface(fn=vs_PHSBERT, inputs="text", outputs="text")
106
  vs = Parallel(vs_bert_io, vs_mental_io, vs_phs_io,
107
  examples=vs_examples,
108
  title=vs_title,
109
- description=vs_desc)
 
110
 
111
  folder = "hm/"
112
  hm_predictor_bert = ktrain.load_predictor(folder + "bert")
@@ -139,7 +140,8 @@ hm_phs_io = Interface(fn=hm_PHSBERT, inputs="text", outputs="text")
139
  hm = Parallel(hm_bert_io, hm_mental_io, hm_phs_io,
140
  examples=hm_examples,
141
  title=hm_title,
142
- description=hm_desc)
 
143
 
144
  folder = "cv/"
145
  covid_predictor_bert = ktrain.load_predictor(folder + "bert")
@@ -168,7 +170,8 @@ covid_phs_io = Interface(fn=covid_PHSBERT, inputs="text", outputs="text")
168
  covid = Parallel(covid_bert_io, covid_mental_io, covid_phs_io,
169
  examples=covid_examples,
170
  title=covid_title,
171
- description=covid_desc)
 
172
 
173
  folder = "st/"
174
  stress_predictor_bert = ktrain.load_predictor(folder + "bert")
@@ -197,7 +200,8 @@ stress_phs_io = Interface(fn=stress_PHSBERT, inputs="text", outputs="text")
197
  stress = Parallel(stress_bert_io, stress_mental_io, stress_phs_io,
198
  examples=stress_examples,
199
  title=stress_title,
200
- description=stress_desc)
 
201
 
202
  folder = "ot/"
203
  other_predictor_bert = ktrain.load_predictor(folder + "bert")
@@ -226,7 +230,8 @@ other_phs_io = Interface(fn=other_PHSBERT, inputs="text", outputs="text")
226
  other = Parallel(other_bert_io, other_mental_io, other_phs_io,
227
  examples=other_examples,
228
  title=other_title,
229
- description=other_desc)
 
230
  # vs_bert_io, vs_mental_io, vs_phs_io = make_interfaces("vs/")
231
  # vs = Parallel(vs_bert_io, vs_mental_io, vs_phs_io,
232
  # examples=vs_examples,
 
6
  ["In child protective services, further providing for definitions, for immunity from liability"],
7
  ["Lol what? Measles is a real thing. Get vaccinated"]]
8
  vs_title = "Vaccine Sentiment Task"
9
+ vs_desc = "Enter vaccine-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The three provided examples have true labels 'vaccine critical', 'neutral', 'vaccine supportive' respectively (NOTE: you may have to click submit again to generate the correct labels)."# For more details, please refer to the VS2 dataset description in our paper (link provided in the corresponding Hugging Face repository)."
10
 
11
  hm_examples = [
12
  ["Serious as a heart attack question/thought Riddle me this. Why, oh why, does cold brew coffee get warm after sitting to long. Taste terrible. And Hot coffee get literally COLD after sitting too long. Tastes terrible. Like what. Why don't cold stay cold and hot only get warm?"],
13
  # ["It's odd how humans are considered predators when they have a heart attack and run like mad when a small insect is running straight towards them."],
14
  ["The older we get the less likely we are to view a sudden massive heart attack as a tragedy than a stroke of good luck."]]
15
  hm_title = "Health Mention Task"
16
+ hm_desc = "Enter health-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The two provided examples have true labels 'Figurative/Hyperbolic Health Mentions', 'Non-personal Health Mentions' respectively (NOTE: you may have to click submit again to generate the correct labels)."# For more details, please refer to the RHMD dataset description in our paper (link provided in the corresponding Hugging Face repository)."
17
 
18
  dep_examples = [
19
  ["Nothing major, some underage drinking, a little pot, but I wasn't a bad kid. Furthermore, I feel like I matured well and have gone on to be successful for my age (24) IMO. I've also had positive experiences with police. The resource officer at my high school was a really good guy and almost like a mentor to me. When I was 17 I was arrested when police raided a friends house because they were tipped off that there was to be some under-aged drinking. Furthermore, I told him before we got really serious that I have anxiety and depression, and if he can’t handle that then I’ll understand if we end things. But *he* chose to stay with me and help me if I wanted it. Honestly I’m just tired of defending myself to him after this fight. I shouldn’t have to. And he kept threatening to break up; then why don’t you do it?"],
 
29
  ["The latest Boarding Pass! #budget2020 #coronavirus"]
30
  ]
31
  covid_title = "COVID Related Task"
32
+ covid_desc = "Enter covid-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The two provided examples have true labels 'news', 'personal narrative' respectively (NOTE: you may have to click submit again to generate the correct labels)."# For more details, please refer to the Covid category dataset description in our paper (link provided in the corresponding Hugging Face repository)."
33
 
34
  # 2nd example looks like the most risk
35
  suicide_examples = [
 
46
  ["My daughter's father I was with for 5 years on and off. He was not abusive the first year, however when he became so I left and found out two weeks later I was pregnant. Of course he begged and pleaded for a second chance, and I believed that my daughter deserved me to at least give it a shot. I came back and surprise surprise it was worse than it ever was. I stuck it out until he disappeared for the eleventeenth time on a drunken bender, I checked my Facebook to find some scumbag girl who was dating one of his best friends was posting horrific, nasty, way out shit about me."]
47
  ]
48
  stress_title = "Stress Task"
49
+ stress_desc = "Enter Reddit posts to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The provided example has a true label of 'stress' (NOTE: you may have to click submit again to generate the correct label)."# For more details, please refer to the Dreaddit dataset description in our paper (link provided in the corresponding Hugging Face repository)."
50
 
51
  other_examples = [
52
  ["@anxietyfighter suffered social anxiety for 4 yrs when i had my first panic attack,got worse when i went to uni, so have just started paxil"],
53
  ["@JessBarrett227 Taking someone off 150mg off Seroquel, mixing it with Olanzapine in 2 wks causes psychosis - a proper assess was not done. "]
54
  ]
55
  other_title = "Other Health Related Task"
56
+ other_desc = "Enter drug-related tweets to generate labels from 3 models (BERT, MentalBERT, PHS-BERT). The two provided examples have true labels 'no adverse drug reaction', 'adverse drug reaction' respectively (NOTE: you may have to click submit again to generate the correct labels)."# For more details, please refer to the SMM4H T1 dataset description in our paper (link provided in the corresponding Hugging Face repository)."
57
 
58
  # def make_interfaces(folder):
59
  # predictor_bert = ktrain.load_predictor(folder + "bert")
 
106
  vs = Parallel(vs_bert_io, vs_mental_io, vs_phs_io,
107
  examples=vs_examples,
108
  title=vs_title,
109
+ description=vs_desc,
110
+ theme="peach")
111
 
112
  folder = "hm/"
113
  hm_predictor_bert = ktrain.load_predictor(folder + "bert")
 
140
  hm = Parallel(hm_bert_io, hm_mental_io, hm_phs_io,
141
  examples=hm_examples,
142
  title=hm_title,
143
+ description=hm_desc,
144
+ theme="peach")
145
 
146
  folder = "cv/"
147
  covid_predictor_bert = ktrain.load_predictor(folder + "bert")
 
170
  covid = Parallel(covid_bert_io, covid_mental_io, covid_phs_io,
171
  examples=covid_examples,
172
  title=covid_title,
173
+ description=covid_desc,
174
+ theme="peach")
175
 
176
  folder = "st/"
177
  stress_predictor_bert = ktrain.load_predictor(folder + "bert")
 
200
  stress = Parallel(stress_bert_io, stress_mental_io, stress_phs_io,
201
  examples=stress_examples,
202
  title=stress_title,
203
+ description=stress_desc,
204
+ theme="peach")
205
 
206
  folder = "ot/"
207
  other_predictor_bert = ktrain.load_predictor(folder + "bert")
 
230
  other = Parallel(other_bert_io, other_mental_io, other_phs_io,
231
  examples=other_examples,
232
  title=other_title,
233
+ description=other_desc,
234
+ theme="peach")
235
  # vs_bert_io, vs_mental_io, vs_phs_io = make_interfaces("vs/")
236
  # vs = Parallel(vs_bert_io, vs_mental_io, vs_phs_io,
237
  # examples=vs_examples,