Spaces:
Sleeping
Sleeping
Update annotation_questions.py
#3
by
Varvara-Gumirova
- opened
- annotation_questions.py +134 -27
annotation_questions.py
CHANGED
|
@@ -28,6 +28,35 @@ yes_no_labels = ['no','yes', 'other']
|
|
| 28 |
yes_no_other_labels = ['no','yes','other']
|
| 29 |
default_labels = agreement_labels
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
consent_text = '''
|
| 32 |
## Consent Form
|
| 33 |
You will be asked to take part in a research study. Before you decide to take part in this study, it is important that you understand why the study is being done and what it involves. Please read the following information carefully.
|
|
@@ -96,33 +125,80 @@ fields0: List[Field] = [
|
|
| 96 |
title="Does the patient describe a particular event or circumstance (e.g., an argument, job loss, injury, crisis) that led them to come to this appointment?",
|
| 97 |
other_params={'labels': yes_no_other_labels}, mandatory=True),
|
| 98 |
Field(name="trigger_desc", type="text", title="If so, describe:", mandatory=False),
|
|
|
|
| 99 |
]),
|
| 100 |
Field(type="container", title="##### Conversational Style", children=[
|
| 101 |
-
Field(name="
|
| 102 |
-
title="
|
| 103 |
-
Field(name="symptom_desc1", type="text", title="If so, which symptoms?", mandatory=False),
|
| 104 |
-
Field(name="
|
| 105 |
-
title="Does the patient
|
| 106 |
-
other_params={
|
| 107 |
-
Field(name="
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
| 112 |
]),
|
| 113 |
Field(type="container", title="##### Behavioral & Pragmatic Properties", children=[
|
| 114 |
-
Field(name="
|
| 115 |
-
title="Does the patient
|
| 116 |
-
|
| 117 |
-
Field(name="
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
Field(name="
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
]),
|
|
|
|
| 126 |
|
| 127 |
####--- END EDIT MARKER
|
| 128 |
]
|
|
@@ -172,19 +248,50 @@ fields1: List[Field] = [
|
|
| 172 |
|
| 173 |
]),
|
| 174 |
|
| 175 |
-
|
|
|
|
| 176 |
Field(type="container", title="##### Overlap with role description", children=[
|
|
|
|
| 177 |
Field(name="played_well", type="y_n_radio",
|
| 178 |
title="The SP played the role well", other_params={"labels": degree_labels}, mandatory=True),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
Field(name="knew_well", type="y_n_radio",
|
| 180 |
-
title="The SP knew his or her role well", other_params={"labels": degree_labels}, mandatory=True),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
Field(name="withhold", type="y_n_radio",
|
| 182 |
title="The SP seemed to withhold information unnecessarily", other_params={"labels": degree_labels}, mandatory=True),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
Field(name="stayed_in_role_well", type="y_n_radio",
|
| 184 |
-
title="The SP stayed in role very well during consultation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
Field(name="stayed_in_role_always", type="y_n_radio",
|
| 186 |
title="SP stays in his/her role all the time", other_params={"labels": degree_labels}, mandatory=True),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
]),
|
|
|
|
| 188 |
####--- END EDIT MARKER
|
| 189 |
|
| 190 |
####--- EDIT MARKER: Interpersonal therapeutic competence
|
|
@@ -250,7 +357,7 @@ SHOW_VALIDATION_ERROR_MESSAGE = True
|
|
| 250 |
# Optional convenience functions, if you really want to "call" them:
|
| 251 |
def get_steps() -> List[List[Field]]:
|
| 252 |
"""Return the list of pages to show."""
|
| 253 |
-
return STEPS
|
| 254 |
|
| 255 |
def get_input_defaults() -> dict:
|
| 256 |
-
return INPUT_FIELD_DEFAULT_VALUES
|
|
|
|
| 28 |
yes_no_other_labels = ['no','yes','other']
|
| 29 |
default_labels = agreement_labels
|
| 30 |
|
| 31 |
+
accuracy_contributor_labels = [
|
| 32 |
+
"",
|
| 33 |
+
"Explicit symptoms mentioned",
|
| 34 |
+
"Clear stressors discussed",
|
| 35 |
+
"Specific triggering event described",
|
| 36 |
+
"Concise communication",
|
| 37 |
+
"Use of colloquial speech",
|
| 38 |
+
"Detailed storytelling",
|
| 39 |
+
"Low self-awareness / disorganized thoughts",
|
| 40 |
+
"Willingness to engage (openness)",
|
| 41 |
+
"Use of sarcasm",
|
| 42 |
+
"Verbal aggression",
|
| 43 |
+
"Controlling behavior",
|
| 44 |
+
"Defiance/resistance",
|
| 45 |
+
"Topic avoidance",
|
| 46 |
+
"Hesitation/mistrust",
|
| 47 |
+
"Solution-focused (not just venting)",
|
| 48 |
+
"Use of humor (non-sarcastic)",
|
| 49 |
+
"Shows empathy",
|
| 50 |
+
"Appears distracted",
|
| 51 |
+
"Responsive to therapist",
|
| 52 |
+
"Actively engaged",
|
| 53 |
+
"Defensive reactions",
|
| 54 |
+
"Self-criticism",
|
| 55 |
+
"Blaming others",
|
| 56 |
+
"Shows insight",
|
| 57 |
+
"Emotional expressiveness"
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
consent_text = '''
|
| 61 |
## Consent Form
|
| 62 |
You will be asked to take part in a research study. Before you decide to take part in this study, it is important that you understand why the study is being done and what it involves. Please read the following information carefully.
|
|
|
|
| 125 |
title="Does the patient describe a particular event or circumstance (e.g., an argument, job loss, injury, crisis) that led them to come to this appointment?",
|
| 126 |
other_params={'labels': yes_no_other_labels}, mandatory=True),
|
| 127 |
Field(name="trigger_desc", type="text", title="If so, describe:", mandatory=False),
|
| 128 |
+
|
| 129 |
]),
|
| 130 |
Field(type="container", title="##### Conversational Style", children=[
|
| 131 |
+
Field(name="conciseness", type="likert_radio",
|
| 132 |
+
title="Are the patient's responses concise? To what degree?", other_params={"labels": degree_labels}, mandatory=True),
|
| 133 |
+
# Field(name="symptom_desc1", type="text", title="If so, which symptoms?", mandatory=False),
|
| 134 |
+
Field(name="colloquial", type="likert_radio",
|
| 135 |
+
title="Does the patient use the colloquial speach? To what degree?",
|
| 136 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 137 |
+
Field(name="detailedness", type="likert_radio",
|
| 138 |
+
title="Does the patient describe specific details to help the therapist understand the situation better? To what degree?",
|
| 139 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 140 |
+
Field(name="self-awareness", type="likert_radio",
|
| 141 |
+
title="Does the patient show low self-awareness and expresses thoughts in an disorganized way? To what degree?",
|
| 142 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 143 |
+
|
| 144 |
]),
|
| 145 |
Field(type="container", title="##### Behavioral & Pragmatic Properties", children=[
|
| 146 |
+
Field(name="openness", type="likert_radio",
|
| 147 |
+
title="Does the patient appear willing to engage in the therapeutic process and work on their concerns? To what degree?",
|
| 148 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 149 |
+
Field(name="sarcasm", type="likert_radio",
|
| 150 |
+
title="Does the patient use sarcasm in their responses to the therapist? To what degree?",
|
| 151 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 152 |
+
Field(name="agression", type="likert_radio",
|
| 153 |
+
title="Does the patient express verbal aggression (e.g., hostile tone, blaming, threatening language)? To what degree?",
|
| 154 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 155 |
+
Field(name="controlling", type="likert_radio",
|
| 156 |
+
title="Does the patient attempt to control the direction, pace, or content of the session (e.g., interrupting, redirecting, dismissing the therapist’s input)? To what degree?",
|
| 157 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 158 |
+
Field(name="defiant", type="likert_radio",
|
| 159 |
+
title="Does the patient openly resist, challenge, or reject the therapist’s suggestions, interpretations, or authority? To what degree?",
|
| 160 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 161 |
+
Field(name="aviodant", type="likert_radio",
|
| 162 |
+
title="Does the patient avoid discussing certain topics, emotions, or questions? To what degree?",
|
| 163 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 164 |
+
Field(name="hesitant", type="likert_radio",
|
| 165 |
+
title="Does the patient show any signs of mistrust and hesitation with the idea of seeking help? To what degree?",
|
| 166 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 167 |
+
Field(name="self-awareness", type="likert_radio",
|
| 168 |
+
title="Is the patient more focused on seeking out solutions rather than just sharing thoughts and feelings? To what degree?",
|
| 169 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 170 |
+
Field(name="humor", type="likert_radio",
|
| 171 |
+
title="Does the patient use humor, jokes, or lighthearted comments (not sarcasm) to communicate or cope? To what degree?",
|
| 172 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 173 |
+
Field(name="empathetic", type="likert_radio",
|
| 174 |
+
title="Does the patient show understanding, concern, or emotional attunement—either toward the therapist or others mentioned in the session? To what degree?",
|
| 175 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 176 |
+
Field(name="distracted", type="likert_radio",
|
| 177 |
+
title="Does the patient seem mentally disengaged, lose track of the conversation, or struggle to stay focused? To what degree?",
|
| 178 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 179 |
+
Field(name="responsive", type="likert_radio",
|
| 180 |
+
title="Does the patient directly address the therapist’s questions, comments, or interventions in a relevant way? To what degree?",
|
| 181 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 182 |
+
Field(name="engaged", type="likert_radio",
|
| 183 |
+
title="Does the patient appear actively engaged when the therapist is speaking? To what degree?",
|
| 184 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 185 |
+
Field(name="defensive", type="likert_radio",
|
| 186 |
+
title="Does the patient react protectively or justify themselves when faced with feedback, interpretations, or questions about their behavior? To what degree?",
|
| 187 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 188 |
+
Field(name="self-critical", type="likert_radio",
|
| 189 |
+
title="Does the patient make negative or harsh judgments about themselves (e.g., “I’m worthless,” “It’s all my fault”)? To what degree?",
|
| 190 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 191 |
+
Field(name="blaming", type="likert_radio",
|
| 192 |
+
title="Does the patient attribute their problems or emotions to other people or external circumstances? To what degree?",
|
| 193 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 194 |
+
Field(name="insightful", type="likert_radio",
|
| 195 |
+
title="Does the patient demonstrate awareness of their own patterns, motivations, or emotions? To what degree?",
|
| 196 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 197 |
+
Field(name="expressive", type="likert_radio",
|
| 198 |
+
title="Does the patient openly convey emotions? To what degree?",
|
| 199 |
+
other_params={"labels": degree_labels}, mandatory=True),
|
| 200 |
]),
|
| 201 |
+
|
| 202 |
|
| 203 |
####--- END EDIT MARKER
|
| 204 |
]
|
|
|
|
| 248 |
|
| 249 |
]),
|
| 250 |
|
| 251 |
+
|
| 252 |
+
# ACCURACY
|
| 253 |
Field(type="container", title="##### Overlap with role description", children=[
|
| 254 |
+
# 1. Played well
|
| 255 |
Field(name="played_well", type="y_n_radio",
|
| 256 |
title="The SP played the role well", other_params={"labels": degree_labels}, mandatory=True),
|
| 257 |
+
Field(type="expander", title="**Justification for 'played well'** *(expand)*", children=[
|
| 258 |
+
Field(type="markdown", title="", other_params={"content": "Select traits that support your rating."}),
|
| 259 |
+
]),
|
| 260 |
+
Field(name="played_well_just", type="accuracy_justification", title="", mandatory=False),
|
| 261 |
+
|
| 262 |
+
# 2. Knew well
|
| 263 |
Field(name="knew_well", type="y_n_radio",
|
| 264 |
+
title="The SP knew his or her role well", other_params={"labels": degree_labels}, mandatory=True),
|
| 265 |
+
Field(type="expander", title="**Justification for 'knew well'** *(expand)*", children=[
|
| 266 |
+
Field(type="markdown", title="", other_params={"content": "Select traits that support your rating."}),
|
| 267 |
+
]),
|
| 268 |
+
Field(name="knew_well_just", type="accuracy_justification", title="", mandatory=False),
|
| 269 |
+
|
| 270 |
+
# 3. Withhold
|
| 271 |
Field(name="withhold", type="y_n_radio",
|
| 272 |
title="The SP seemed to withhold information unnecessarily", other_params={"labels": degree_labels}, mandatory=True),
|
| 273 |
+
Field(type="expander", title="**Justification for 'withhold'** *(expand)*", children=[
|
| 274 |
+
Field(type="markdown", title="", other_params={"content": "Select traits that support your rating."}),
|
| 275 |
+
]),
|
| 276 |
+
Field(name="withhold_just", type="accuracy_justification", title="", mandatory=False),
|
| 277 |
+
|
| 278 |
+
# 4. Stayed in role well
|
| 279 |
Field(name="stayed_in_role_well", type="y_n_radio",
|
| 280 |
+
title="The SP stayed in role very well during consultation", other_params={"labels": degree_labels}, mandatory=True),
|
| 281 |
+
Field(type="expander", title="**Justification for 'stayed in role well'** *(expand)*", children=[
|
| 282 |
+
Field(type="markdown", title="", other_params={"content": "Select traits that support your rating."}),
|
| 283 |
+
]),
|
| 284 |
+
Field(name="stayed_in_role_well_just", type="accuracy_justification", title="", mandatory=False),
|
| 285 |
+
|
| 286 |
+
# 5. Stayed in role always
|
| 287 |
Field(name="stayed_in_role_always", type="y_n_radio",
|
| 288 |
title="SP stays in his/her role all the time", other_params={"labels": degree_labels}, mandatory=True),
|
| 289 |
+
Field(type="expander", title="**Justification for 'stayed in role always'** *(expand)*", children=[
|
| 290 |
+
Field(type="markdown", title="", other_params={"content": "Select traits that support your rating."}),
|
| 291 |
+
]),
|
| 292 |
+
Field(name="stayed_in_role_always_just", type="accuracy_justification", title="", mandatory=False),
|
| 293 |
]),
|
| 294 |
+
|
| 295 |
####--- END EDIT MARKER
|
| 296 |
|
| 297 |
####--- EDIT MARKER: Interpersonal therapeutic competence
|
|
|
|
| 357 |
# Optional convenience functions, if you really want to "call" them:
|
| 358 |
def get_steps() -> List[List[Field]]:
|
| 359 |
"""Return the list of pages to show."""
|
| 360 |
+
return STEPS
|
| 361 |
|
| 362 |
def get_input_defaults() -> dict:
|
| 363 |
+
return INPUT_FIELD_DEFAULT_VALUES
|