Spaces:
Sleeping
Sleeping
Feat: Add warning if confidence is blank
Browse files
app.py
CHANGED
|
@@ -321,8 +321,10 @@ def next_example(emotions, confidence, comments, n_clicks, participant_id, ann_c
|
|
| 321 |
|
| 322 |
if emotions == "Blank":
|
| 323 |
gr.Warning("Please fill out the emotion section. 'Blank' is not a valid emotion.")
|
| 324 |
-
|
| 325 |
-
|
|
|
|
|
|
|
| 326 |
ann_completed = save_annotation(emotions, confidence, comments, n_clicks, participant_id, ann_completed, current_index)
|
| 327 |
if current_index < len(file_list) - 1:
|
| 328 |
current_index += 1
|
|
@@ -351,9 +353,12 @@ def deactivate_participant_id(participant_id, lets_go, total, previous_button, n
|
|
| 351 |
|
| 352 |
|
| 353 |
sentence, audio_player, emotions, confidence, comments, n_clicks, start, end, duration, ann_completed, current_index = load_first_example(participant_id, ann_completed, current_index)
|
| 354 |
-
|
|
|
|
| 355 |
participant_id = gr.Textbox(label='What is your participant ID?', value = participant_id, interactive = False)
|
| 356 |
lets_go = gr.Button("Participant selected!", interactive = False)
|
|
|
|
|
|
|
| 357 |
emotions = gr.Radio(["Blank", "Joy", "Sad", "Angry", "Neutral"], label="Predominant Emotion", value = emotions, visible = True)
|
| 358 |
confidence = gr.Radio(["Blank","Very Uncertain", "Somewhat Uncertain", "Neutral", "Somewhat confident", "Very confident"], label="How confident are you that the annotated emotion is present in the recording?", visible = True, value = confidence)
|
| 359 |
comments = gr.Textbox(label="Comments", visible =True, value = comments)
|
|
|
|
| 321 |
|
| 322 |
if emotions == "Blank":
|
| 323 |
gr.Warning("Please fill out the emotion section. 'Blank' is not a valid emotion.")
|
| 324 |
+
elif confidence == "Blank":
|
| 325 |
+
gr.Warning("Please fill out the confidence section. 'Blank' is not a valid input.")
|
| 326 |
+
|
| 327 |
+
else:
|
| 328 |
ann_completed = save_annotation(emotions, confidence, comments, n_clicks, participant_id, ann_completed, current_index)
|
| 329 |
if current_index < len(file_list) - 1:
|
| 330 |
current_index += 1
|
|
|
|
| 353 |
|
| 354 |
|
| 355 |
sentence, audio_player, emotions, confidence, comments, n_clicks, start, end, duration, ann_completed, current_index = load_first_example(participant_id, ann_completed, current_index)
|
| 356 |
+
print(sentence)
|
| 357 |
+
print(start, end, duration)
|
| 358 |
participant_id = gr.Textbox(label='What is your participant ID?', value = participant_id, interactive = False)
|
| 359 |
lets_go = gr.Button("Participant selected!", interactive = False)
|
| 360 |
+
|
| 361 |
+
sentence_text = gr.Textbox(label="Transcription", interactive=False, value = sentence)
|
| 362 |
emotions = gr.Radio(["Blank", "Joy", "Sad", "Angry", "Neutral"], label="Predominant Emotion", value = emotions, visible = True)
|
| 363 |
confidence = gr.Radio(["Blank","Very Uncertain", "Somewhat Uncertain", "Neutral", "Somewhat confident", "Very confident"], label="How confident are you that the annotated emotion is present in the recording?", visible = True, value = confidence)
|
| 364 |
comments = gr.Textbox(label="Comments", visible =True, value = comments)
|