giobin commited on
Commit
4a58e4d
·
verified ·
1 Parent(s): fadec32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -55,9 +55,9 @@ def update_name():
55
 
56
  if st.session_state.username is None:
57
  with st.form("user_form"):
58
- st.write("### Select Your Name")
59
- selected_user = st.selectbox("Choose your name:", valid_users, key="selected_user")
60
- submit_button = st.form_submit_button("Start", on_click=update_name)
61
  st.stop()
62
 
63
  # Retrieve assigned dataset and filter out already labeled samples
@@ -67,7 +67,7 @@ dataset = full_dataset[~full_dataset["id"].isin(user_labeled_ids)].reset_index(d
67
 
68
  # Check if all samples are labeled
69
  if st.session_state.index >= len(dataset):
70
- st.write("### Great! You have completed your assignment. 🎉")
71
  st.stop()
72
 
73
  # Function to push updated annotations to Hugging Face Hub
@@ -101,7 +101,7 @@ def save_choice():
101
 
102
  # Save results and push to Hugging Face Hub if all samples are labeled
103
  if st.session_state.index >= len(dataset):
104
- st.write("### Great! You have completed your assignment. 🎉")
105
  result_df = pd.DataFrame(st.session_state.results)
106
  csv_path = "user_selections.csv"
107
  if not existing_annotations.empty:
@@ -120,11 +120,11 @@ st.write("\n\n")
120
 
121
  # Instructions
122
  st.markdown("""
123
- ### Instructions:
124
- - Look at the video thumbnail; do not play it.
125
- - Select the correct description (A or B).
126
- - If the frame does not provide enough information to answer the question, select the checkbox.
127
- - Click 'Next' to proceed.
128
  """)
129
  st.write("---")
130
 
@@ -137,12 +137,13 @@ with st.form("annotation_form"):
137
  selected_answer = st.radio(
138
  "Choose the correct description:",
139
  options=[0, 1],
 
140
  format_func=lambda x: f"A: {sample['answer1']}" if x == 0 else f"B: {sample['answer2']}",
141
  key="selected_answer"
142
  )
143
 
144
  # Independent checkbox for insufficient information
145
- not_enough_info = st.checkbox("The frame does not provide enough information to answer the question.", key="not_enough_info")
146
 
147
  # Submit button
148
- submit_button = st.form_submit_button("Next", on_click=save_choice)
 
55
 
56
  if st.session_state.username is None:
57
  with st.form("user_form"):
58
+ st.write("### Seleziona il tuo nome")
59
+ selected_user = st.selectbox("Nome:", valid_users, key="selected_user")
60
+ submit_button = st.form_submit_button("Inizia il task", on_click=update_name)
61
  st.stop()
62
 
63
  # Retrieve assigned dataset and filter out already labeled samples
 
67
 
68
  # Check if all samples are labeled
69
  if st.session_state.index >= len(dataset):
70
+ st.write("### Ottimo. Hai completato il tuo task! 🎉")
71
  st.stop()
72
 
73
  # Function to push updated annotations to Hugging Face Hub
 
101
 
102
  # Save results and push to Hugging Face Hub if all samples are labeled
103
  if st.session_state.index >= len(dataset):
104
+ st.write("### Ottimo. Hai completato il tuo task! 🎉")
105
  result_df = pd.DataFrame(st.session_state.results)
106
  csv_path = "user_selections.csv"
107
  if not existing_annotations.empty:
 
120
 
121
  # Instructions
122
  st.markdown("""
123
+ ### Istruzioni:
124
+ - Osserva attentamente il frame del video (senza premere play) e cerca di capire il contesto della scena
125
+ - Valuta le opzioni (A e B) e seleziona quella che ritieni più attinente al video.
126
+ - Se il frame non contiene tutte le informazioni necessarie per decidere con certezza l’alternativa, seleziona il checkbox sottostante.
127
+ - Clicca 'Continua' per procedere.
128
  """)
129
  st.write("---")
130
 
 
137
  selected_answer = st.radio(
138
  "Choose the correct description:",
139
  options=[0, 1],
140
+ index=None,
141
  format_func=lambda x: f"A: {sample['answer1']}" if x == 0 else f"B: {sample['answer2']}",
142
  key="selected_answer"
143
  )
144
 
145
  # Independent checkbox for insufficient information
146
+ not_enough_info = st.checkbox("Il frame non contiene abbastanza informazioni per scegliere con sicurezza", key="not_enough_info")
147
 
148
  # Submit button
149
+ submit_button = st.form_submit_button("Continua", on_click=save_choice)