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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,9 +9,9 @@ CSV_FILENAME = "user_selections.csv"
9
  # Function to assign samples to users
10
  def assign_samples(csv_path):
11
  df = pd.read_csv(csv_path)
12
- group_1 = df[(df["pool_pos"] == 1) & (~df["question_category"].str.endswith("_B"))].head(5)
13
- group_2 = df[(df["pool_pos"] == 2) & (~df["question_category"].str.endswith("_B"))].head(5)
14
- group_3 = df[(df["pool_pos"] == 3) & (~df["question_category"].str.endswith("_B"))].head(5)
15
  return {
16
  "Bernardo": group_1,
17
  "Alessandro": group_1,
@@ -135,7 +135,7 @@ st.video(sample["video_url"])
135
  with st.form("annotation_form"):
136
  # Exclusive choice between A and B
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']}",
 
9
  # Function to assign samples to users
10
  def assign_samples(csv_path):
11
  df = pd.read_csv(csv_path)
12
+ group_1 = df[(df["pool_pos"] == 1) & (~df["question_category"].str.endswith("_B"))].iloc[100:150] # select 50 sampels from the 100th
13
+ group_2 = df[(df["pool_pos"] == 2) & (~df["question_category"].str.endswith("_B"))].iloc[100:150]
14
+ group_3 = df[(df["pool_pos"] == 3) & (~df["question_category"].str.endswith("_B"))].iloc[100:150]
15
  return {
16
  "Bernardo": group_1,
17
  "Alessandro": group_1,
 
135
  with st.form("annotation_form"):
136
  # Exclusive choice between A and B
137
  selected_answer = st.radio(
138
+ "Seleziona la descrizione corretta:",
139
  options=[0, 1],
140
  index=None,
141
  format_func=lambda x: f"A: {sample['answer1']}" if x == 0 else f"B: {sample['answer2']}",