Spaces:
Sleeping
Sleeping
Feat: Tweaked instructions styling
Browse files
app.py
CHANGED
|
@@ -10,27 +10,49 @@ css = """#myProgress {
|
|
| 10 |
border-radius: 2px;
|
| 11 |
}
|
| 12 |
|
| 13 |
-
#myBar {
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
}
|
| 19 |
-
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
"""
|
| 35 |
|
| 36 |
js_progress_bar = """
|
|
@@ -42,33 +64,58 @@ js_progress_bar = """
|
|
| 42 |
}
|
| 43 |
"""
|
| 44 |
|
| 45 |
-
intro = """
|
| 46 |
-
# Emotionality in Speech
|
| 47 |
-
Spoken language communicates more than just words. Speakers use tone, pitch, and other nonverbal cues to express emotions. In emotional speech, these cues can strengthen or even contradict the meaning of the words—for example, irony can make a positive phrase sound sarcastic. For this research, we will focus on three basic emotions plus neutral:
|
| 48 |
-
\n* Anger
|
| 49 |
-
\n* Happiness
|
| 50 |
-
\n* Sadness
|
| 51 |
-
\n* Neutral
|
| 52 |
-
\nThis may seem like a small set, but it's a great starting point for analyzing emotions in such a large collection—303 hours of interviews! (That’s 13 days of nonstop listening!)"""
|
| 53 |
-
|
| 54 |
-
about_act_up = """
|
| 55 |
-
## What is the archive you will be annotating?
|
| 56 |
-
You will be annotating short audio clips extracted from the ACT UP (AIDS Coalition to Unleash Power) Oral History Project. This archive features interviews with individuals who were part of ACT UP during the late 1980s and early 1990s, amidst the AIDS epidemic.
|
| 57 |
-
In each video, the subjects talk about their life before the epidemic, how they were affected by AIDS and their work in ACT UP.
|
| 58 |
-
"""
|
| 59 |
-
about_emotions = """
|
| 60 |
-
## What will you be annotating?
|
| 61 |
-
You will annotate one emotion per short audio clip, based on the following criteria:
|
| 62 |
-
\n* Predominant Emotion: The emotion expressed with the highest intensity. Emotions can be complex, and multiple emotions may occur at the same time.
|
| 63 |
-
\n* Perceived Emotion at the Time of Recording: In Oral History Archives, interviewees discuss their past. However, you should annotate the emotion they appear to feel at the time of recording, NOT what they felt during the event they describe.
|
| 64 |
-
\n* Speech Emotionality: Focus on how something is said rather than what is said. For example, if a friend recounts an awful day with humor, the content may be sad, but the delivery is joyful. In this case, linguistic emotionality (content) would be classified as sad, while paralinguistic emotionality (tone and delivery) would be classified as joyful.
|
| 65 |
-
|
| 66 |
-
Further, you will be asked to fill "How confident you are that the annotated emotion is present in the recording?" from a scale of 0 to 10, with 0 being "not at all confident" and 1 being "certain, completely confident".
|
| 67 |
-
\nThere will be a "Comment/Feedback" section where you can makes notes.
|
| 68 |
-
\nBelow the audio, there will be an option to view the transcribed sentence. Please use this only if you are struggling to understand the audio.
|
| 69 |
-
\nLet’s explore the four possible categories and listen to some examples!
|
| 70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
"""
|
|
|
|
| 72 |
# List of all audio files to annotate
|
| 73 |
file_list = pd.read_excel(os.path.join('combined_annotations.xlsx'))
|
| 74 |
total_annotations = len(file_list)
|
|
@@ -158,10 +205,8 @@ with (gr.Blocks(theme=gr.themes.Soft(), css = css) as demo):
|
|
| 158 |
#happy_words = gr.Textbox(label = "Happy")
|
| 159 |
|
| 160 |
|
| 161 |
-
with gr.Tab("Instructions"):
|
| 162 |
-
instructions = gr.
|
| 163 |
-
about_data = gr.Markdown(about_act_up)
|
| 164 |
-
about_em = gr.Markdown(about_emotions)
|
| 165 |
|
| 166 |
agreement = gr.Checkbox(value = False, label = "I agree", info = "I agree to have my annotations, comments, and questionnaire answers used for research purposes. I understand that any personal information will be anonymized.", interactive = True)
|
| 167 |
|
|
@@ -169,7 +214,7 @@ with (gr.Blocks(theme=gr.themes.Soft(), css = css) as demo):
|
|
| 169 |
|
| 170 |
with gr.Tab("Annotation Interface"):
|
| 171 |
|
| 172 |
-
ann_completed = gr.Number(
|
| 173 |
total = gr.Number(total_annotations, visible=False)
|
| 174 |
|
| 175 |
# Row with progress bar
|
|
@@ -178,7 +223,7 @@ with (gr.Blocks(theme=gr.themes.Soft(), css = css) as demo):
|
|
| 178 |
<div id="myBar">
|
| 179 |
<span id="progressText">Press "Let's go!" to start</span>
|
| 180 |
</div>
|
| 181 |
-
</div>""")
|
| 182 |
|
| 183 |
# Row with audio player
|
| 184 |
with gr.Row():
|
|
|
|
| 10 |
border-radius: 2px;
|
| 11 |
}
|
| 12 |
|
| 13 |
+
#myBar {
|
| 14 |
+
width: 0%;
|
| 15 |
+
height: 30px;
|
| 16 |
+
background-color: var(--block-title-background-fill);
|
| 17 |
+
border-radius: 2px;
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
#progressText {
|
| 21 |
+
position: absolute;
|
| 22 |
+
top: 50%;
|
| 23 |
+
left: 50%;
|
| 24 |
+
transform: translate(-50%, -50%);
|
| 25 |
+
color: var(--block-title-text-color);
|
| 26 |
+
font-weight: regular;
|
| 27 |
+
font-size: 14px;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
h1, h2, h3, h4 {
|
| 31 |
+
padding: var(--block-title-padding);
|
| 32 |
+
color: var(--block-title-text-color);
|
| 33 |
+
border: solid var(--block-title-border-width) var(--block-title-border-color);
|
| 34 |
+
border-radius: var(--block-title-radius);
|
| 35 |
+
background: var(--block-title-background-fill);
|
| 36 |
+
width: fit-content;
|
| 37 |
+
display: inline-block;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
h4 {
|
| 41 |
+
margin: 0px;
|
| 42 |
+
color: var(--primary-800);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
#instructions {
|
| 46 |
+
max-width: 980px;
|
| 47 |
+
align-self: center;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.content-box {
|
| 51 |
+
border-color: var(--block-border-color);
|
| 52 |
+
border-radius: var(--block-radius);
|
| 53 |
+
background: var(--block-background-fill);
|
| 54 |
+
padding: var(--block-label-padding);
|
| 55 |
+
}
|
| 56 |
"""
|
| 57 |
|
| 58 |
js_progress_bar = """
|
|
|
|
| 64 |
}
|
| 65 |
"""
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
intro_html = """
|
| 69 |
+
<h1>Emotionality in Speech</h1>
|
| 70 |
+
|
| 71 |
+
<div class="content-box">
|
| 72 |
+
<p>Spoken language communicates more than just words. Speakers use tone, pitch, and other nonverbal cues to express emotions. In emotional speech, these cues can strengthen or even contradict the meaning of the words—for example, irony can make a positive phrase sound sarcastic. For this research, we will focus on three basic emotions plus neutral:</p>
|
| 73 |
+
|
| 74 |
+
<ul>
|
| 75 |
+
<li><h4>Anger</h4></li>
|
| 76 |
+
<li><h4>Happiness</h4></li>
|
| 77 |
+
<li><h4>Sadness</h4></li>
|
| 78 |
+
<li><h4>Neutral</h4></li>
|
| 79 |
+
</ul>
|
| 80 |
+
|
| 81 |
+
<p>This may seem like a small set, but it's a great starting point for analyzing emotions in such a large collection—303 hours of interviews! (That’s 13 days of nonstop listening!)</p>
|
| 82 |
+
</div>
|
| 83 |
+
|
| 84 |
+
<h2>What is the archive you will be annotating?</h2>
|
| 85 |
+
|
| 86 |
+
<div class="content-box">
|
| 87 |
+
<p>You will be annotating short audio clips extracted from the ACT UP (AIDS Coalition to Unleash Power) Oral History Project. This archive features interviews with individuals who were part of ACT UP during the late 1980s and early 1990s, amidst the AIDS epidemic.</p>
|
| 88 |
+
|
| 89 |
+
<p>In each video, the subjects talk about their life before the epidemic, how they were affected by AIDS and their work in ACT UP.</p>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
<h2>What will you be annotating?</h2>
|
| 93 |
+
|
| 94 |
+
<div class="content-box">
|
| 95 |
+
<p>You will annotate one emotion per short audio clip, based on the following criteria:</p>
|
| 96 |
+
|
| 97 |
+
<ul>
|
| 98 |
+
<li>
|
| 99 |
+
<strong>Predominant Emotion:</strong> The emotion expressed with the highest intensity. Emotions can be complex, and multiple emotions may occur at the same time.
|
| 100 |
+
</li>
|
| 101 |
+
|
| 102 |
+
<li>
|
| 103 |
+
<strong>Perceived Emotion at the Time of Recording:</strong> In Oral History Archives, interviewees discuss their past. However, you should annotate the emotion they appear to feel at the time of recording, NOT what they felt during the event they describe.
|
| 104 |
+
</li>
|
| 105 |
+
|
| 106 |
+
<li>
|
| 107 |
+
<strong>Speech Emotionality:</strong> Focus on how something is said rather than what is said. For example, if a friend recounts an awful day with humor, the content may be sad, but the delivery is joyful. In this case, linguistic emotionality (content) would be classified as sad, while paralinguistic emotionality (tone and delivery) would be classified as joyful.
|
| 108 |
+
</li>
|
| 109 |
+
</ul>
|
| 110 |
+
|
| 111 |
+
<p>Further, you will be asked to fill "How confident you are that the annotated emotion is present in the recording?" from a scale of 0 to 10, with 0 being "not at all confident" and 1 being "certain, completely confident".</p>
|
| 112 |
+
|
| 113 |
+
<p>There will be a "Comment/Feedback" section where you can makes notes.<br>Below the audio, there will be an option to view the transcribed sentence. Please use this only if you are struggling to understand the audio.</p>
|
| 114 |
+
|
| 115 |
+
<p>Let’s explore the four possible categories and listen to some examples!</p>
|
| 116 |
+
</div>
|
| 117 |
"""
|
| 118 |
+
|
| 119 |
# List of all audio files to annotate
|
| 120 |
file_list = pd.read_excel(os.path.join('combined_annotations.xlsx'))
|
| 121 |
total_annotations = len(file_list)
|
|
|
|
| 205 |
#happy_words = gr.Textbox(label = "Happy")
|
| 206 |
|
| 207 |
|
| 208 |
+
with gr.Tab("Instructions", elem_id = 'instructions'):
|
| 209 |
+
instructions = gr.HTML(intro_html, padding = False)
|
|
|
|
|
|
|
| 210 |
|
| 211 |
agreement = gr.Checkbox(value = False, label = "I agree", info = "I agree to have my annotations, comments, and questionnaire answers used for research purposes. I understand that any personal information will be anonymized.", interactive = True)
|
| 212 |
|
|
|
|
| 214 |
|
| 215 |
with gr.Tab("Annotation Interface"):
|
| 216 |
|
| 217 |
+
ann_completed = gr.Number(0, visible=False)
|
| 218 |
total = gr.Number(total_annotations, visible=False)
|
| 219 |
|
| 220 |
# Row with progress bar
|
|
|
|
| 223 |
<div id="myBar">
|
| 224 |
<span id="progressText">Press "Let's go!" to start</span>
|
| 225 |
</div>
|
| 226 |
+
</div>""", padding = False)
|
| 227 |
|
| 228 |
# Row with audio player
|
| 229 |
with gr.Row():
|