Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,7 +114,7 @@ def sample_audio_paths(audio_paths, count_data, k=5, max_count=3):
|
|
| 114 |
eligible_paths = [p for p in audio_paths if count_data.get(os.path.basename(p), 0) < max_count]
|
| 115 |
|
| 116 |
if len(eligible_paths) < k:
|
| 117 |
-
raise ValueError(f"
|
| 118 |
|
| 119 |
# selected = random.sample(eligible_paths, k)
|
| 120 |
random.shuffle(eligible_paths)
|
|
@@ -421,6 +421,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container {max-width: 960px
|
|
| 421 |
gender_input = gr.Radio(["男", "女", "其他"], label="性别")
|
| 422 |
education_input = gr.Radio(["高中及以下", "本科", "硕士", "博士", "其他(请注明)"], label="学历")
|
| 423 |
education_other_input = gr.Textbox(label="请填写你的学历", visible=False, interactive=False)
|
|
|
|
| 424 |
submit_info_btn = gr.Button("提交并开始学习样例", variant="primary", interactive=False)
|
| 425 |
|
| 426 |
with sample_page:
|
|
@@ -432,11 +433,11 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container {max-width: 960px
|
|
| 432 |
sample_audio = gr.Audio(label="样例音频", value=DIMENSIONS_DATA[0]["audio"])
|
| 433 |
with gr.Column(scale=2):
|
| 434 |
with gr.Column(visible=True) as interactive_view:
|
| 435 |
-
gr.Markdown("#### 请为以下特征打分 (
|
| 436 |
-
sample_sliders = [gr.Slider(minimum=
|
| 437 |
with gr.Column(visible=False) as reference_view:
|
| 438 |
-
gr.Markdown("### 参考答案解析 (
|
| 439 |
-
reference_sliders = [gr.Slider(minimum=
|
| 440 |
with gr.Row():
|
| 441 |
reference_btn = gr.Button("参考")
|
| 442 |
go_to_pretest_btn = gr.Button("我明白了,开始测试", variant="primary")
|
|
@@ -444,8 +445,14 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container {max-width: 960px
|
|
| 444 |
with pretest_page:
|
| 445 |
gr.Markdown("## 测试说明\n"
|
| 446 |
"- 对于每一道题,你都需要对全部 **5 个维度** 进行评估。\n"
|
| 447 |
-
"- 在每个维度下,请为出现的每个特征 **从
|
| 448 |
-
"-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
"- 你可以使用“上一维度”和“下一维度”按钮在5个维度间自由切换和修改分数。")
|
| 450 |
go_to_test_btn = gr.Button("开始测试", variant="primary")
|
| 451 |
|
|
@@ -454,8 +461,8 @@ with gr.Blocks(theme=gr.themes.Soft(), css=".gradio-container {max-width: 960px
|
|
| 454 |
question_progress_text = gr.Markdown()
|
| 455 |
test_dimension_title = gr.Markdown()
|
| 456 |
test_audio = gr.Audio(label="测试音频")
|
| 457 |
-
gr.Markdown("--- \n ### 请为以下特征打分 (
|
| 458 |
-
test_sliders = [gr.Slider(minimum=
|
| 459 |
with gr.Row():
|
| 460 |
prev_dim_btn = gr.Button("上一维度")
|
| 461 |
next_dim_btn = gr.Button("下一维度", variant="primary")
|
|
|
|
| 114 |
eligible_paths = [p for p in audio_paths if count_data.get(os.path.basename(p), 0) < max_count]
|
| 115 |
|
| 116 |
if len(eligible_paths) < k:
|
| 117 |
+
raise ValueError(f"可用音频数量不足(只剩 {len(eligible_paths)} 条 count<{max_count} 的音频),无法抽取 {k} 条")
|
| 118 |
|
| 119 |
# selected = random.sample(eligible_paths, k)
|
| 120 |
random.shuffle(eligible_paths)
|
|
|
|
| 421 |
gender_input = gr.Radio(["男", "女", "其他"], label="性别")
|
| 422 |
education_input = gr.Radio(["高中及以下", "本科", "硕士", "博士", "其他(请注明)"], label="学历")
|
| 423 |
education_other_input = gr.Textbox(label="请填写你的学历", visible=False, interactive=False)
|
| 424 |
+
# ai_experience_input = gr.Textbox(["从未使用过", "偶尔接触(如看别人用)", "使用过几次,了解基本功能", "经常使用,有一定操作经验", "非常熟悉,深入使用过多个 AI 工具"], label="对 AI 工具的熟悉程度")
|
| 425 |
submit_info_btn = gr.Button("提交并开始学习样例", variant="primary", interactive=False)
|
| 426 |
|
| 427 |
with sample_page:
|
|
|
|
| 433 |
sample_audio = gr.Audio(label="样例音频", value=DIMENSIONS_DATA[0]["audio"])
|
| 434 |
with gr.Column(scale=2):
|
| 435 |
with gr.Column(visible=True) as interactive_view:
|
| 436 |
+
gr.Markdown("#### 请为以下特征打分 (1-5分。1对应机器,5对应人类)")
|
| 437 |
+
sample_sliders = [gr.Slider(minimum=1, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=True) for i in range(MAX_SUB_DIMS)]
|
| 438 |
with gr.Column(visible=False) as reference_view:
|
| 439 |
+
gr.Markdown("### 参考答案解析 (1-5分。1对应机器,5对应人类)")
|
| 440 |
+
reference_sliders = [gr.Slider(minimum=1, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=False) for i in range(MAX_SUB_DIMS)]
|
| 441 |
with gr.Row():
|
| 442 |
reference_btn = gr.Button("参考")
|
| 443 |
go_to_pretest_btn = gr.Button("我明白了,开始测试", variant="primary")
|
|
|
|
| 445 |
with pretest_page:
|
| 446 |
gr.Markdown("## 测试说明\n"
|
| 447 |
"- 对于每一道题,你都需要对全部 **5 个维度** 进行评估。\n"
|
| 448 |
+
"- 在每个维度下,请为出现的每个特征 **从1到5打分。\n"
|
| 449 |
+
"- **评分解释如下:**\n"
|
| 450 |
+
" - **1 分:极度符合机器特征**,如语气僵硬、表达机械、缺乏自然语流等;\n"
|
| 451 |
+
" - **2 分:较为符合机器特征**,部分特征显得不自然或存在明显模式化;\n"
|
| 452 |
+
" - **3 分:中立,无明显人类或机器倾向**;\n"
|
| 453 |
+
" - **4 分:较为符合人类特征**,表现出自然的语用与语言行为;\n"
|
| 454 |
+
" - **5 分:极度符合人类特征**,流畅、真实、有情感色彩。\n"
|
| 455 |
+
"- 完成所有维度后,请根据整体印象对回应方的身份做出做出“人类”或“机器人”的 **最终判断**。"
|
| 456 |
"- 你可以使用“上一维度”和“下一维度”按钮在5个维度间自由切换和修改分数。")
|
| 457 |
go_to_test_btn = gr.Button("开始测试", variant="primary")
|
| 458 |
|
|
|
|
| 461 |
question_progress_text = gr.Markdown()
|
| 462 |
test_dimension_title = gr.Markdown()
|
| 463 |
test_audio = gr.Audio(label="测试音频")
|
| 464 |
+
gr.Markdown("--- \n ### 请为以下特征打分 (1-5分。1对应机器,5对应人类)")
|
| 465 |
+
test_sliders = [gr.Slider(minimum=1, maximum=5, step=1, label=f"Sub-dim {i+1}", visible=False, interactive=True) for i in range(MAX_SUB_DIMS)]
|
| 466 |
with gr.Row():
|
| 467 |
prev_dim_btn = gr.Button("上一维度")
|
| 468 |
next_dim_btn = gr.Button("下一维度", variant="primary")
|