Spark Chou commited on
Commit
3620b6d
·
1 Parent(s): 76578a8
Files changed (1) hide show
  1. app.py +51 -48
app.py CHANGED
@@ -858,79 +858,82 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container {max-width: 960px
858
  }
859
 
860
  with welcome_page:
861
- gr.Markdown("# AI Indentifier: Can you spot the AI?\n你将听到一系列对话,请判断哪个回应者是 AI")
862
  start_btn = gr.Button("Start", variant="primary")
863
 
864
  with info_page:
865
- gr.Markdown("## 请提供一些基本信息")
866
- username_input = gr.Textbox(label="用户名", placeholder="请输入你的昵称")
867
- age_input = gr.Radio(["18岁以下", "18-25", "26-35", "36-50", "50岁以上"], label="年龄")
868
- gender_input = gr.Radio(["", "", "其他"], label="性别")
869
- education_input = gr.Radio(["高中及以下", "本科", "硕士", "博士", "其他"], label="学历")
870
- education_other_input = gr.Textbox(label="请填写你的学历", visible=False, interactive=False)
871
- ai_experience_input = gr.Radio(["从未使用过", "偶尔接触(如看别人用)", "使用过几次,了解基本功能", "经常使用,有一定操作经验", "非常熟悉,深入使用过多个 AI 工具"], label="对 AI 工具的熟悉程度")
872
- submit_info_btn = gr.Button("提交并开始学习样例", variant="primary", interactive=False)
 
 
 
 
 
 
873
 
874
- with sample_page:
875
 
876
- gr.Markdown("## 样例分析\n请选择一个维度进行学习和打分练习。所有维度共用同一个样例音频。")
877
- sample_dimension_selector = gr.Radio(DIMENSION_TITLES, label="选择学习维度", value=DIMENSION_TITLES[0])
 
878
  with gr.Row():
879
  with gr.Column(scale=1):
880
- sample_audio = gr.Audio(label="样例音频", value=DIMENSIONS_DATA[0]["audio"])
881
  with gr.Column(scale=2):
882
  with gr.Column(visible=True) as interactive_view:
883
- gr.Markdown("#### 请为以下特征打分 (0-5分。0-特征无体现;1-机器;3-特征无偏向;5-人类)")
884
  sample_sliders = [gr.Slider(minimum=0, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=True) for i in range(MAX_SUB_DIMS)]
885
  with gr.Column(visible=False) as reference_view:
886
- gr.Markdown("### 参考答案解析")
887
  reference_sliders = [gr.Slider(minimum=0, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=False) for i in range(MAX_SUB_DIMS)]
888
  with gr.Row():
889
- reference_btn = gr.Button("参考")
890
- go_to_pretest_btn = gr.Button("我明白了,开始测试", variant="primary")
891
 
892
  with pretest_page:
893
- gr.Markdown("## 测试说明\n"
894
- "- 对于每一道题,你都需要对全部 **5 个维度** 进行评估。\n"
895
- "- 在每个维度下,请为出现的每个特征 **从0到5打分**。\n"
896
- "- **评分解释如下:**\n"
897
- " - **0 分:特征未体现** (有些特征一定会体现,所以按1到5打分);\n"
898
- " - **1 分:极度符合机器特征**;\n"
899
- " - **2 分��较为符合机器特征**;\n"
900
- " - **3 分:无明显人类或机器倾向**;\n"
901
- " - **4 分:较为符合人类特征**;\n"
902
- " - **5 分:极度符合人类特征**。\n"
903
- "- 完成所有维度后,请根据整体印象对回应方的身份做出做出“人类”或“机器人”的 **最终判断**。\n"
904
- "- 你可以使用“上一维度”和“下一维度”按钮在5个维度间自由切换和修改分数。\n"
905
- "## 特别注意\n"
906
- "- 我们希望您能判断每个维度上**回应者**的表现是**偏向人还是机器**,分数的大小反映回应者的语音类人的程度,而**不是**这个维度体现的程度多少\n(如读音正确也不代表是人类,读音错误也不代表是机器,您应当判断的是“听到的发音更偏向机器还是人类”)\n"
907
- "- 即使您一开始就已经很肯定回应方的身份,同样应当**独立地**对每个维度上回应方的表现进行细致的评判。比如您很肯定回应方是机器,也需要独立地对每个维度判断,而非简单地将每个维度归为偏机器。")
908
- go_to_test_btn = gr.Button("开始测试", variant="primary")
909
 
 
 
 
910
  with test_page:
911
- gr.Markdown("## 正式测试")
912
  question_progress_text = gr.Markdown()
913
  test_dimension_title = gr.Markdown()
914
- test_audio = gr.Audio(label="测试音频")
915
- gr.Markdown("--- \n ### 请为对话中的回应者(非发起者)针对以下特征打分 (0-5分。0-特征无体现;1-机器;3-特征无偏向;5-人类)")
916
-
917
- test_sliders = [gr.Slider(minimum=0, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=True, show_label = True) for i in range(MAX_SUB_DIMS)]
918
-
919
  with gr.Row():
920
- prev_dim_btn = gr.Button("上一维度")
921
- next_dim_btn = gr.Button("下一维度", variant="primary")
922
 
923
  with final_judgment_page:
924
- gr.Markdown("## 最终判断")
925
- gr.Markdown("您已完成对所有维度的评分。请根据您的综合印象,做出最终判断。")
926
- final_human_robot_radio = gr.Radio(["👤 人类", "🤖 机器人"], label="请判断回应者类型 (必填)")
927
- submit_final_answer_btn = gr.Button("提交本题答案", variant="primary", interactive=False)
928
 
929
  with result_page:
930
- gr.Markdown("## 测试完成")
931
  result_text = gr.Markdown()
932
- back_to_welcome_btn = gr.Button("返回主界面", variant="primary")
933
-
934
  # ==============================================================================
935
  # 事件绑定 (Event Binding) & IO 列表定义
936
  # ==============================================================================
 
858
  }
859
 
860
  with welcome_page:
861
+ gr.Markdown("# Can you spot the hidden AI?\nListen to the following conversations. Please determine which respondent is an AI.")
862
  start_btn = gr.Button("Start", variant="primary")
863
 
864
  with info_page:
865
+ gr.Markdown("## Basic Information")
866
+ username_input = gr.Textbox(label="Username", placeholder="Please enter your nickname")
867
+ age_input = gr.Radio(["Under 18", "18-25", "26-35", "36-50", "Over 50"], label="Age")
868
+ gender_input = gr.Radio(["Male", "Female", "Other"], label="Gender")
869
+ education_input = gr.Radio(["High school or below", "Bachelor", "Master", "PhD", "Other (please specify)"], label="Education Level")
870
+ education_other_input = gr.Textbox(label="Please enter your education", visible=False, interactive=False)
871
+ ai_experience_input = gr.Radio([
872
+ "Never used",
873
+ "Occasionally exposed (e.g., watching others use)",
874
+ "Used a few times, understand basic functions",
875
+ "Use frequently, have some experience",
876
+ "Very familiar, have in-depth experience with multiple AI tools"
877
+ ], label="Familiarity with AI Tools")
878
+ submit_info_btn = gr.Button("Submit and Start Learning Sample", variant="primary", interactive=False)
879
 
 
880
 
881
+ with sample_page:
882
+ gr.Markdown("## Sample Analysis\nPlease select a dimension to study and practice scoring. All dimensions share the same sample audio.")
883
+ sample_dimension_selector = gr.Radio(DIMENSION_TITLES, label="Select Learning Dimension", value=DIMENSION_TITLES[0])
884
  with gr.Row():
885
  with gr.Column(scale=1):
886
+ sample_audio = gr.Audio(label="Sample Audio", value=DIMENSIONS_DATA[0]["audio"])
887
  with gr.Column(scale=2):
888
  with gr.Column(visible=True) as interactive_view:
889
+ gr.Markdown("#### Please rate the following features (0-5 points. 0 - Feature not present; 1 - Machine; 3 - Neutral; 5 - Human)")
890
  sample_sliders = [gr.Slider(minimum=0, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=True) for i in range(MAX_SUB_DIMS)]
891
  with gr.Column(visible=False) as reference_view:
892
+ gr.Markdown("### Reference Answer Explanation (1-5 points. 1 = Machine, 5 = Human)")
893
  reference_sliders = [gr.Slider(minimum=0, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=False) for i in range(MAX_SUB_DIMS)]
894
  with gr.Row():
895
+ reference_btn = gr.Button("Reference")
896
+ go_to_pretest_btn = gr.Button("Got it, start the test", variant="primary")
897
 
898
  with pretest_page:
899
+ gr.Markdown("## Test Instructions\n"
900
+ "- For each question, you need to evaluate **all 5 dimensions**.\n"
901
+ "- Within each dimension, please rate each appearing feature **from 1 to 5**.\n"
902
+ "- **Scoring Guide:**\n"
903
+ " - **0 points: Feature not present**;\n"
904
+ " - **1 point: Strongly machine-like**;\n"
905
+ " - **2 points: Somewhat machine-like**;\n"
906
+ " - **3 points: Neutral**;\n"
907
+ " - **4 points: Somewhat human-like**;\n"
908
+ " - **5 points: Strongly human-like**.\n"
909
+ "- After completing all dimensions, make a **final judgment** on whether the respondent is “Human” or “AI” based on your overall impression.\n"
910
+ "- You can use the “Previous Dimension” and “Next Dimension” buttons to freely switch and modify scores across the 5 dimensions.")
911
+ go_to_test_btn = gr.Button("Start Test", variant="primary")
 
 
 
912
 
913
+
914
+
915
+
916
  with test_page:
917
+ gr.Markdown("## Formal Test")
918
  question_progress_text = gr.Markdown()
919
  test_dimension_title = gr.Markdown()
920
+ test_audio = gr.Audio(label="Test Audio")
921
+ gr.Markdown("--- \n ### Please rate the respondent (not the initiator) in the conversation based on the following features (0-5 points. 0 - Feature not present; 1 - Machine; 3 - Neutral; 5 - Human)")
922
+ test_sliders = [gr.Slider(minimum=0, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=True) for i in range(MAX_SUB_DIMS)]
 
 
923
  with gr.Row():
924
+ prev_dim_btn = gr.Button("Previous Dimension")
925
+ next_dim_btn = gr.Button("Next Dimension", variant="primary")
926
 
927
  with final_judgment_page:
928
+ gr.Markdown("## Final Judgment")
929
+ gr.Markdown("You have completed scoring for all dimensions. Please make a final judgment based on your overall impression.")
930
+ final_human_robot_radio = gr.Radio(["👤 Human", "🤖 AI"], label="Please determine the respondent type (required)")
931
+ submit_final_answer_btn = gr.Button("Submit Answer for This Question", variant="primary", interactive=False)
932
 
933
  with result_page:
934
+ gr.Markdown("## Test Completed")
935
  result_text = gr.Markdown()
936
+ back_to_welcome_btn = gr.Button("Back to Main Page", variant="primary")
 
937
  # ==============================================================================
938
  # 事件绑定 (Event Binding) & IO 列表定义
939
  # ==============================================================================