HappyColor commited on
Commit
441dcc1
·
verified ·
1 Parent(s): 04c8847

Use speech clips under 10s, drop the listen checkbox, and set Times New Roman

Browse files
.gitattributes CHANGED
@@ -41,3 +41,7 @@ audio/71f95ca1-a409-47b0-af02-80a272f776d5.mp3 filter=lfs diff=lfs merge=lfs -te
41
  audio/7d857919-89a2-42ca-9cd8-bd75ad56a147.mp3 filter=lfs diff=lfs merge=lfs -text
42
  audio/d9d7f111-da32-47cb-baa0-fd5ba4e4bca1.mp3 filter=lfs diff=lfs merge=lfs -text
43
  audio/f995bc92-74f6-4e69-94b8-bf6e073fa19f.mp3 filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
41
  audio/7d857919-89a2-42ca-9cd8-bd75ad56a147.mp3 filter=lfs diff=lfs merge=lfs -text
42
  audio/d9d7f111-da32-47cb-baa0-fd5ba4e4bca1.mp3 filter=lfs diff=lfs merge=lfs -text
43
  audio/f995bc92-74f6-4e69-94b8-bf6e073fa19f.mp3 filter=lfs diff=lfs merge=lfs -text
44
+ audio/1b9e32b8-cf8e-42d6-bc08-292ad5857d67.mp3 filter=lfs diff=lfs merge=lfs -text
45
+ audio/54d927bb-d3ef-42c7-b09c-25f94ccf252e.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ audio/85ca4722-71ec-47dd-b3e2-8337d376a513.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ audio/ed934345-29e0-4511-b12f-a66d160b9fd5.mp3 filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -26,7 +26,7 @@ pinned: false
26
 
27
  ## 题目
28
 
29
- 第一部分来自 MMAU test-mini 的 speech 子集。两边都有 `perceiver_description`、音频能找到的样本里,用 seed 42 抽了 10 段。每一题同时播放音频并展示两段描述,左右顺序随机。播放文件是原始 wav 转出来的 192 kbps MP3。
30
 
31
  打分规则与 `temp/rebuttal/desc_support.py` 相同:只判断描述里已经写出的说法是否符合音频,不评价完整性。1 到 5 分。只打分,不要求写下不准确的句子。
32
 
 
26
 
27
  ## 题目
28
 
29
+ 第一部分只从 MMAU test-mini 的 speech 子集抽取,并且每段不超过 10 秒。两边都有 `perceiver_description` 的样本里,用 seed 42 抽了 10 段。每一题同时播放音频并展示两段描述,左右顺序随机。播放文件是原始 wav 转出来的 192 kbps MP3。
30
 
31
  打分规则与 `temp/rebuttal/desc_support.py` 相同:只判断描述里已经写出的说法是否符合音频,不评价完整性。1 到 5 分。只打分,不要求写下不准确的句子。
32
 
app.py CHANGED
@@ -129,7 +129,6 @@ def view(state: Optional[Dict[str, Any]], message: str = "", kind: str = "error"
129
  "desc_score_1": None,
130
  "desc_text_2": "",
131
  "desc_score_2": None,
132
- "desc_listened": False,
133
  "desc_prev": gr.update(interactive=False),
134
  "desc_next": gr.update(value="下一题"),
135
  "aspect_progress": "",
@@ -162,7 +161,6 @@ def view(state: Optional[Dict[str, Any]], message: str = "", kind: str = "error"
162
  "desc_score_1": None if stored_left["score"] is None else str(stored_left["score"]),
163
  "desc_text_2": right["description"],
164
  "desc_score_2": None if stored_right["score"] is None else str(stored_right["score"]),
165
- "desc_listened": stored_left["listened"] or stored_right["listened"],
166
  "desc_prev": gr.update(interactive=index > 0),
167
  "desc_next": gr.update(value="进入第二部分" if index + 1 == total else "下一题"),
168
  }
@@ -205,7 +203,6 @@ OUTPUT_KEYS = [
205
  "desc_score_1",
206
  "desc_text_2",
207
  "desc_score_2",
208
- "desc_listened",
209
  "desc_prev",
210
  "desc_next",
211
  "aspect_progress",
@@ -264,12 +261,11 @@ def on_desc(
264
  state: Optional[Dict[str, Any]],
265
  score_left: Any,
266
  score_right: Any,
267
- listened: bool,
268
  step: int,
269
  ) -> tuple:
270
  if not state or state.get("phase") != "desc":
271
  return pack(view(state, "当前不在描述评测。"))
272
- updated, message = STUDY.move_desc(copy.deepcopy(state), score_left, score_right, listened, step)
273
  return pack(view(updated, message))
274
 
275
 
@@ -312,7 +308,7 @@ def build_demo() -> gr.Blocks:
312
  with gr.Column(visible=False) as desc_panel:
313
  desc_progress = gr.Markdown()
314
  gr.Markdown(
315
- "请先完整听完音频,再给两段描述分别打分。"
316
  "**不要因为描述短或有遗漏而扣分。** 左右顺序是随机的。"
317
  )
318
  desc_audio = gr.Audio(label="原始音频", interactive=False, type="filepath")
@@ -325,7 +321,6 @@ def build_demo() -> gr.Blocks:
325
  desc_score_2 = gr.Radio(choices=SCORE_CHOICES, label="描述 2 的准确性")
326
  with gr.Accordion("评分规则", open=False):
327
  gr.Markdown(RUBRIC)
328
- desc_listened = gr.Checkbox(label="我已经完整听完这段音频")
329
  with gr.Row():
330
  desc_prev = gr.Button("上一题")
331
  desc_next = gr.Button("下一题", variant="primary")
@@ -365,7 +360,6 @@ def build_demo() -> gr.Blocks:
365
  desc_score_1,
366
  desc_text_2,
367
  desc_score_2,
368
- desc_listened,
369
  desc_prev,
370
  desc_next,
371
  aspect_progress,
@@ -384,18 +378,14 @@ def build_demo() -> gr.Blocks:
384
  cont.click(resume, [name], outputs, api_name="resume")
385
  restart_btn.click(restart, [name, acknowledged], outputs, api_name="restart")
386
  desc_next.click(
387
- lambda state, score_left, score_right, listened: on_desc(
388
- state, score_left, score_right, listened, 1
389
- ),
390
- [state, desc_score_1, desc_score_2, desc_listened],
391
  outputs,
392
  api_name="desc_next",
393
  )
394
  desc_prev.click(
395
- lambda state, score_left, score_right, listened: on_desc(
396
- state, score_left, score_right, listened, -1
397
- ),
398
- [state, desc_score_1, desc_score_2, desc_listened],
399
  outputs,
400
  api_name="desc_prev",
401
  )
@@ -418,11 +408,23 @@ def build_demo() -> gr.Blocks:
418
  demo = build_demo()
419
 
420
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  if __name__ == "__main__":
422
  launch_kwargs = {
423
  "allowed_paths": [str((ROOT / "audio").resolve())],
424
- "theme": gr.themes.Soft(),
425
- "css": ".gradio-container {max-width: 1080px !important; margin-left: auto !important; margin-right: auto !important;}",
426
  }
427
  if os.environ.get("MOS_PORT"):
428
  launch_kwargs["server_name"] = os.environ.get("MOS_HOST", "127.0.0.1")
 
129
  "desc_score_1": None,
130
  "desc_text_2": "",
131
  "desc_score_2": None,
 
132
  "desc_prev": gr.update(interactive=False),
133
  "desc_next": gr.update(value="下一题"),
134
  "aspect_progress": "",
 
161
  "desc_score_1": None if stored_left["score"] is None else str(stored_left["score"]),
162
  "desc_text_2": right["description"],
163
  "desc_score_2": None if stored_right["score"] is None else str(stored_right["score"]),
 
164
  "desc_prev": gr.update(interactive=index > 0),
165
  "desc_next": gr.update(value="进入第二部分" if index + 1 == total else "下一题"),
166
  }
 
203
  "desc_score_1",
204
  "desc_text_2",
205
  "desc_score_2",
 
206
  "desc_prev",
207
  "desc_next",
208
  "aspect_progress",
 
261
  state: Optional[Dict[str, Any]],
262
  score_left: Any,
263
  score_right: Any,
 
264
  step: int,
265
  ) -> tuple:
266
  if not state or state.get("phase") != "desc":
267
  return pack(view(state, "当前不在描述评测。"))
268
+ updated, message = STUDY.move_desc(copy.deepcopy(state), score_left, score_right, step)
269
  return pack(view(updated, message))
270
 
271
 
 
308
  with gr.Column(visible=False) as desc_panel:
309
  desc_progress = gr.Markdown()
310
  gr.Markdown(
311
+ "请听完音频,再给两段描述分别打分。"
312
  "**不要因为描述短或有遗漏而扣分。** 左右顺序是随机的。"
313
  )
314
  desc_audio = gr.Audio(label="原始音频", interactive=False, type="filepath")
 
321
  desc_score_2 = gr.Radio(choices=SCORE_CHOICES, label="描述 2 的准确性")
322
  with gr.Accordion("评分规则", open=False):
323
  gr.Markdown(RUBRIC)
 
324
  with gr.Row():
325
  desc_prev = gr.Button("上一题")
326
  desc_next = gr.Button("下一题", variant="primary")
 
360
  desc_score_1,
361
  desc_text_2,
362
  desc_score_2,
 
363
  desc_prev,
364
  desc_next,
365
  aspect_progress,
 
378
  cont.click(resume, [name], outputs, api_name="resume")
379
  restart_btn.click(restart, [name, acknowledged], outputs, api_name="restart")
380
  desc_next.click(
381
+ lambda state, score_left, score_right: on_desc(state, score_left, score_right, 1),
382
+ [state, desc_score_1, desc_score_2],
 
 
383
  outputs,
384
  api_name="desc_next",
385
  )
386
  desc_prev.click(
387
+ lambda state, score_left, score_right: on_desc(state, score_left, score_right, -1),
388
+ [state, desc_score_1, desc_score_2],
 
 
389
  outputs,
390
  api_name="desc_prev",
391
  )
 
408
  demo = build_demo()
409
 
410
 
411
+ PAGE_CSS = """
412
+ .gradio-container {
413
+ max-width: 1080px !important;
414
+ margin-left: auto !important;
415
+ margin-right: auto !important;
416
+ }
417
+ .gradio-container, .gradio-container * {
418
+ font-family: "Times New Roman", Times, serif !important;
419
+ }
420
+ """
421
+
422
+
423
  if __name__ == "__main__":
424
  launch_kwargs = {
425
  "allowed_paths": [str((ROOT / "audio").resolve())],
426
+ "theme": gr.themes.Soft(font=["Times New Roman", "Times", "serif"]),
427
+ "css": PAGE_CSS,
428
  }
429
  if os.environ.get("MOS_PORT"):
430
  launch_kwargs["server_name"] = os.environ.get("MOS_HOST", "127.0.0.1")
audio/{0ed9d7c8-3b63-4861-af81-925d4176c059.mp3 → 1b9e32b8-cf8e-42d6-bc08-292ad5857d67.mp3} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:bb1ba83d4c27681366bcf994366116c779024a22e8b54e69a2a6af7d27d989c9
3
- size 576044
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6cd68d980257d182ec37864cc11a25992619e4cf61a3a4265241b2a420da009
3
+ size 108764
audio/26600e97-5df3-43be-80ed-ff817c078a77.mp3 DELETED
Binary file (67.8 kB)
 
audio/30bb0e51-2077-4217-ac2b-a2c7019f35ee.mp3 DELETED
Binary file (72.1 kB)
 
audio/3c4fa8f8-972a-4dcb-a24b-e5d1039dd23f.mp3 ADDED
Binary file (67.1 kB). View file
 
audio/427ba822-c000-4303-bf21-7da0a703efc2.mp3 ADDED
Binary file (62.7 kB). View file
 
audio/47ae81d9-8cb5-4267-9394-2f511cc84871.mp3 ADDED
Binary file (73.4 kB). View file
 
audio/{3ffe9ee1-8d66-4542-aab3-b40fbde3f157.mp3 → 54d927bb-d3ef-42c7-b09c-25f94ccf252e.mp3} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f66d29bbc5f580d0e48b0f74df50addf04fece9a615c0b80aeed8107b6bfa3ec
3
- size 259595
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6d369677ee31a483b7c4b3f0a08cc339d61a31455c2d2eb079d7a8b26a6da0e
3
+ size 164301
audio/71f95ca1-a409-47b0-af02-80a272f776d5.mp3 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0942b01542e18f1acf3b83f0b672aaebcfbe19b8648554780ece65cf10db332f
3
- size 241964
 
 
 
 
audio/7d857919-89a2-42ca-9cd8-bd75ad56a147.mp3 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:981a56f86760d94484f9f612a81f01a5c402276068b187a96fc086a9ffe58357
3
- size 319781
 
 
 
 
audio/7e68bc7b-2ab8-48a9-88db-bcc7b2e0dd5e.mp3 ADDED
Binary file (69 kB). View file
 
audio/{2b6096e7-a66f-451f-886b-8210e362f84b.mp3 → 85ca4722-71ec-47dd-b3e2-8337d376a513.mp3} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3ed7374bba43cd81f420c37508315dd7613c3b947e2a8829502f8c040e4a70d6
3
- size 110384
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:073350cc141355948dec479833e62be4f6a79d108f2d4b12010558035d48f6ad
3
+ size 151964
audio/91eb5cf6-e889-495e-81b6-8756eb629e59.mp3 ADDED
Binary file (58.3 kB). View file
 
audio/d9d7f111-da32-47cb-baa0-fd5ba4e4bca1.mp3 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:99b7ab44f3f1fdff53c063b2251af287673842460fd61274cdcf5aba3573df3c
3
- size 149804
 
 
 
 
audio/{6966bbc3-e2c0-40f4-9002-90983182b802.mp3 → ed934345-29e0-4511-b12f-a66d160b9fd5.mp3} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:00c852331dff4bcadece882807f9d813902b9628f4a0082dc4649ad4ecd907ed
3
- size 601244
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9cddeadb42526db189918cdd8837eeac6fdb46ef9a4023a79416ba348ce6fc99
3
+ size 137342
audio/f995bc92-74f6-4e69-94b8-bf6e073fa19f.mp3 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ba4b17ea63292fe950944317448dcaf7624d664cda0df64db61ca248410cd564
3
- size 108044
 
 
 
 
audio/fec3402e-7883-45c0-90d4-38647f615dc3.mp3 ADDED
Binary file (86.4 kB). View file
 
data/desc_items.json CHANGED
@@ -1,169 +1,170 @@
1
  {
2
  "task": "description_accuracy",
3
  "subset": "speech",
 
4
  "seed": 42,
5
  "n_audios": 10,
6
  "playback": "192 kbps MP3 transcoded from the original wav",
7
  "items": [
8
  {
9
- "uid": "f995bc92-74f6-4e69-94b8-bf6e073fa19f::A",
10
- "audio_id": "f995bc92-74f6-4e69-94b8-bf6e073fa19f",
11
- "audio": "audio/f995bc92-74f6-4e69-94b8-bf6e073fa19f.mp3",
12
- "duration_sec": 5.28,
13
  "system": "A",
14
- "description": "Counting words with stressed phonemes: \"and\", \"they\", \"watched\", \"me\", \"one\", \"day\", \"I\", \"don't\". Total: 8 words."
15
  },
16
  {
17
- "uid": "f995bc92-74f6-4e69-94b8-bf6e073fa19f::B",
18
- "audio_id": "f995bc92-74f6-4e69-94b8-bf6e073fa19f",
19
- "audio": "audio/f995bc92-74f6-4e69-94b8-bf6e073fa19f.mp3",
20
- "duration_sec": 5.28,
21
  "system": "B",
22
- "description": "A female speaker with a high-pitched, loud voice delivers the utterance \"And they--and they watched me, and one day I don't--\" at a slow pace, with clear stress on the words \"watched\" and \"don't,\" each containing at least one stressed phoneme, and the utterance includes two instances of the word \"they\" with distinct stress patterns."
23
  },
24
  {
25
- "uid": "30bb0e51-2077-4217-ac2b-a2c7019f35ee::A",
26
- "audio_id": "30bb0e51-2077-4217-ac2b-a2c7019f35ee",
27
- "audio": "audio/30bb0e51-2077-4217-ac2b-a2c7019f35ee.mp3",
28
- "duration_sec": 2.94,
29
  "system": "A",
30
- "description": "“sloppy”"
31
  },
32
  {
33
- "uid": "30bb0e51-2077-4217-ac2b-a2c7019f35ee::B",
34
- "audio_id": "30bb0e51-2077-4217-ac2b-a2c7019f35ee",
35
- "audio": "audio/30bb0e51-2077-4217-ac2b-a2c7019f35ee.mp3",
36
- "duration_sec": 2.94,
37
  "system": "B",
38
- "description": "The word \"sloppy\" is spoken first with a clear, natural delivery by a teenage girl, characterized by a high-pitched, moderate-volume voice and a steady speaking rate. The word is pronounced with a slight emphasis on the \"p\" at the beginning, followed by a brief pause before the next word, \"skiers,\" which is spoken with a slightly lower pitch and a more relaxed articulation. The transition between \"sloppy\" and \"skiers\" is smooth, with no disfluencies or pauses in between."
39
  },
40
  {
41
- "uid": "0ed9d7c8-3b63-4861-af81-925d4176c059::A",
42
- "audio_id": "0ed9d7c8-3b63-4861-af81-925d4176c059",
43
- "audio": "audio/0ed9d7c8-3b63-4861-af81-925d4176c059.mp3",
44
- "duration_sec": 28.68,
45
  "system": "A",
46
- "description": "First speaker shows fear and happiness. Second speaker shows fear, neutral, and happiness."
47
  },
48
  {
49
- "uid": "0ed9d7c8-3b63-4861-af81-925d4176c059::B",
50
- "audio_id": "0ed9d7c8-3b63-4861-af81-925d4176c059",
51
- "audio": "audio/0ed9d7c8-3b63-4861-af81-925d4176c059.mp3",
52
- "duration_sec": 28.68,
53
  "system": "B",
54
- "description": "The first speaker, a woman, speaks with a high-pitched, rapid delivery and noticeable vocal tension, using phrases like \"Good God!\" and \"I wonder\" with rising intonation and slight tremors, indicating fear. She then shifts to a softer, more affectionate tone with \"We're okay, right, darling?\" and \"No, and always,\" delivered with warmth and a steady rhythm, suggesting happiness. The second speaker, a man, speaks in a calm, measured tone with low pitch and consistent volume, using phrases like \"must be them\" and \"what are we going to do?\" with a flat intonation and no vocal stress, conveying neutrality. He later says \"I don't care, then,\" with a relaxed, slightly dismissive delivery, indicating happiness."
55
  },
56
  {
57
- "uid": "7d857919-89a2-42ca-9cd8-bd75ad56a147::A",
58
- "audio_id": "7d857919-89a2-42ca-9cd8-bd75ad56a147",
59
- "audio": "audio/7d857919-89a2-42ca-9cd8-bd75ad56a147.mp3",
60
- "duration_sec": 13.26,
61
  "system": "A",
62
- "description": "Final utterance: \"Well, yes, Ross, pressing my third nipple opens the delivery entrance to the magical land of Narnia.\" This statement is sarcastic as it implies that the speaker is joking about the existence of Narnia, which is a fictional land from a children's book series. The speaker is likely making a humorous comment about the absurdity of the question asked by Ross."
63
  },
64
  {
65
- "uid": "7d857919-89a2-42ca-9cd8-bd75ad56a147::B",
66
- "audio_id": "7d857919-89a2-42ca-9cd8-bd75ad56a147",
67
- "audio": "audio/7d857919-89a2-42ca-9cd8-bd75ad56a147.mp3",
68
- "duration_sec": 13.26,
69
  "system": "B",
70
- "description": "A man speaks with a calm, steady tone and moderate pace, delivering the line \"Pressing my third nipple opens the delivery entrance to the magical land of Narnia\" with a deliberate, slightly exaggerated intonation on \"magical land of Narnia,\" followed by a brief pause and a flat, dismissive delivery of \"Yes, Ross?\" The contrast between the serious-sounding setup and the absurdity of the claim is emphasized through the tone and rhythm, conveying disbelief and irony."
71
  },
72
  {
73
- "uid": "71f95ca1-a409-47b0-af02-80a272f776d5::A",
74
- "audio_id": "71f95ca1-a409-47b0-af02-80a272f776d5",
75
- "audio": "audio/71f95ca1-a409-47b0-af02-80a272f776d5.mp3",
76
- "duration_sec": 10.0,
77
  "system": "A",
78
- "description": "There is a high level of excitement and cheering, suggesting a celebratory event. The presence of words like \"cheering\" and \"celebration\" indicates a positive and energetic atmosphere."
79
  },
80
  {
81
- "uid": "71f95ca1-a409-47b0-af02-80a272f776d5::B",
82
- "audio_id": "71f95ca1-a409-47b0-af02-80a272f776d5",
83
- "audio": "audio/71f95ca1-a409-47b0-af02-80a272f776d5.mp3",
84
- "duration_sec": 10.0,
85
  "system": "B",
86
- "description": "A group of people is heard cheering and clapping loudly, with repeated bursts of enthusiastic vocalizations and rhythmic clapping, indicating excitement and collective celebration; the speech is energetic and sustained, with no signs of distress or hesitation, suggesting a positive, high-intensity event."
87
  },
88
  {
89
- "uid": "6966bbc3-e2c0-40f4-9002-90983182b802::A",
90
- "audio_id": "6966bbc3-e2c0-40f4-9002-90983182b802",
91
- "audio": "audio/6966bbc3-e2c0-40f4-9002-90983182b802.mp3",
92
- "duration_sec": 29.94,
93
  "system": "A",
94
- "description": "Both speakers express sadness, indicating a shift in emotion during the conversation."
95
  },
96
  {
97
- "uid": "6966bbc3-e2c0-40f4-9002-90983182b802::B",
98
- "audio_id": "6966bbc3-e2c0-40f4-9002-90983182b802",
99
- "audio": "audio/6966bbc3-e2c0-40f4-9002-90983182b802.mp3",
100
- "duration_sec": 29.94,
101
  "system": "B",
102
- "description": "The first speaker, a young male with a high-pitched voice, speaks at a normal volume and pace, delivering the line \"This is really--this is unfair\" with a noticeable rise in pitch and emotional intensity, indicating a shift in affect. The second speaker, a female with a lower pitch and steady volume, responds with a calm, neutral tone, showing no emotional shift. The first speaker's vocal delivery changes from neutral to emotionally charged, while the second remains consistently composed."
103
  },
104
  {
105
- "uid": "3ffe9ee1-8d66-4542-aab3-b40fbde3f157::A",
106
- "audio_id": "3ffe9ee1-8d66-4542-aab3-b40fbde3f157",
107
- "audio": "audio/3ffe9ee1-8d66-4542-aab3-b40fbde3f157.mp3",
108
- "duration_sec": 10.75,
109
  "system": "A",
110
- "description": "Key words and entities: \"It's an absurd reason.\" \"It's a compliment.\" \"It's about the weather.\" \"It's about food preferences.\" The speaker's intent is to express that the reason given for the house sale is not a valid or reasonable one, implying sarcasm."
111
  },
112
  {
113
- "uid": "3ffe9ee1-8d66-4542-aab3-b40fbde3f157::B",
114
- "audio_id": "3ffe9ee1-8d66-4542-aab3-b40fbde3f157",
115
- "audio": "audio/3ffe9ee1-8d66-4542-aab3-b40fbde3f157.mp3",
116
- "duration_sec": 10.75,
117
  "system": "B",
118
- "description": "A man speaks with a high-pitched, exaggerated tone, delivering the line \"No, I'm upset because Joe Piscopo didn't get the lead role in Rain Man\" with a noticeable pause before \"No,\" followed by a rising intonation and a slightly accelerated speaking rate, suggesting irony. The delivery is marked by a lighthearted, almost theatrical inflection, and the mention of Joe Piscopo's absence is emphasized with a sharp, exaggerated stress on \"didn't get,\" implying disbelief and humor rather than genuine concern."
119
  },
120
  {
121
- "uid": "2b6096e7-a66f-451f-886b-8210e362f84b::A",
122
- "audio_id": "2b6096e7-a66f-451f-886b-8210e362f84b",
123
- "audio": "audio/2b6096e7-a66f-451f-886b-8210e362f84b.mp3",
124
- "duration_sec": 4.54,
125
  "system": "A",
126
- "description": "Lexical and semantic content of the speech includes the phrase \"Tour de France titles\" which indicates the context of the question. The speaker mentions Lance Armstrong, a well-known athlete, and the context of the Tour de France, a prestigious cycling event. The question asks about the number of titles stripped from the athlete, suggesting a specific number is being sought."
127
  },
128
  {
129
- "uid": "2b6096e7-a66f-451f-886b-8210e362f84b::B",
130
- "audio_id": "2b6096e7-a66f-451f-886b-8210e362f84b",
131
- "audio": "audio/2b6096e7-a66f-451f-886b-8210e362f84b.mp3",
132
- "duration_sec": 4.54,
133
  "system": "B",
134
- "description": "A male speaker with a high-pitched, loud voice delivers the utterance \"I couldn't believe when Lance Armstrong was stripped of his Tour de France titles,\" emphasizing \"Tour de France titles\" with a rising intonation and clear articulation, indicating a specific reference to multiple titles; the phrase \"Tour de France\" is spoken with distinct stress and a slightly prolonged duration, suggesting a focus on the event's significance."
135
  },
136
  {
137
- "uid": "d9d7f111-da32-47cb-baa0-fd5ba4e4bca1::A",
138
- "audio_id": "d9d7f111-da32-47cb-baa0-fd5ba4e4bca1",
139
- "audio": "audio/d9d7f111-da32-47cb-baa0-fd5ba4e4bca1.mp3",
140
- "duration_sec": 7.36,
141
  "system": "A",
142
- "description": "Words: \"I\", \"said\", \"would\", \"it\", \"make\", \"sense\", \"since\", \"I'm\", \"Hispanic\", \"American\", \"why\", \"don't\", \"we\", \"change\", \"the\", \"name\", \"to\", \"Punch\", \"Rello\", \"and\", \"make\", \"him\", \"in\", \"a\", \"Spanish\", \"American\"."
143
  },
144
  {
145
- "uid": "d9d7f111-da32-47cb-baa0-fd5ba4e4bca1::B",
146
- "audio_id": "d9d7f111-da32-47cb-baa0-fd5ba4e4bca1",
147
- "audio": "audio/d9d7f111-da32-47cb-baa0-fd5ba4e4bca1.mp3",
148
- "duration_sec": 7.36,
149
  "system": "B",
150
- "description": "The speaker is a slow-speaking adult male with a low-pitched voice delivering the utterance: \"I said, would it make sense, since I'm Hispanic American, why don't we change the name to 'Pancherello' and make him a Hispanic American?\" The words \"would it make sense,\" \"why don't we change,\" and \"Hispanic American\" each contain at least one unstressed phoneme, resulting in a total of four words with unstressed phonemes."
151
  },
152
  {
153
- "uid": "26600e97-5df3-43be-80ed-ff817c078a77::A",
154
- "audio_id": "26600e97-5df3-43be-80ed-ff817c078a77",
155
- "audio": "audio/26600e97-5df3-43be-80ed-ff817c078a77.mp3",
156
- "duration_sec": 2.75,
157
  "system": "A",
158
- "description": "Octavia"
159
  },
160
  {
161
- "uid": "26600e97-5df3-43be-80ed-ff817c078a77::B",
162
- "audio_id": "26600e97-5df3-43be-80ed-ff817c078a77",
163
- "audio": "audio/26600e97-5df3-43be-80ed-ff817c078a77.mp3",
164
- "duration_sec": 2.75,
165
  "system": "B",
166
- "description": "The speaker, a young male with a natural tone, delivers the sentence \"Octavia's upchuck was oddly orange\" at a slow pace, with clear articulation and steady intonation. The word \"Octavia\" is pronounced with a slight emphasis on the first syllable, followed by a brief pause before continuing with \"was oddly orange,\" where \"orange\" is spoken with a rising pitch and moderate stress on the final syllable."
167
  }
168
  ]
169
  }
 
1
  {
2
  "task": "description_accuracy",
3
  "subset": "speech",
4
+ "max_duration_sec": 10.0,
5
  "seed": 42,
6
  "n_audios": 10,
7
  "playback": "192 kbps MP3 transcoded from the original wav",
8
  "items": [
9
  {
10
+ "uid": "47ae81d9-8cb5-4267-9394-2f511cc84871::A",
11
+ "audio_id": "47ae81d9-8cb5-4267-9394-2f511cc84871",
12
+ "audio": "audio/47ae81d9-8cb5-4267-9394-2f511cc84871.mp3",
13
+ "duration_sec": 3.0,
14
  "system": "A",
15
+ "description": "Lexical & Semantic Content: \"Gertie's\" is the first word in the sentence."
16
  },
17
  {
18
+ "uid": "47ae81d9-8cb5-4267-9394-2f511cc84871::B",
19
+ "audio_id": "47ae81d9-8cb5-4267-9394-2f511cc84871",
20
+ "audio": "audio/47ae81d9-8cb5-4267-9394-2f511cc84871.mp3",
21
+ "duration_sec": 3.0,
22
  "system": "B",
23
+ "description": "The word \"great-grandma\" is spoken first with a clear, natural delivery by a young female speaker, characterized by a high pitch, normal volume, and steady speaking rate. The pronunciation is precise, with no disfluencies or pauses, and the word is followed by a brief pause before the next word, \"aghast,\" which is spoken with a slightly rising intonation and moderate stress on the first syllable."
24
  },
25
  {
26
+ "uid": "1b9e32b8-cf8e-42d6-bc08-292ad5857d67::A",
27
+ "audio_id": "1b9e32b8-cf8e-42d6-bc08-292ad5857d67",
28
+ "audio": "audio/1b9e32b8-cf8e-42d6-bc08-292ad5857d67.mp3",
29
+ "duration_sec": 5.32,
30
  "system": "A",
31
+ "description": "Counting words with at least one unstressed phoneme: \"but\", \"he\", \"was\", \"trying\", \"to\", \"make\", \"a\", \"surprise\", \"party\", \"and\", \"I\", \"knew\", \"all\", \"about\", \"it\", \"he\", \"was\", \"trying\", \"to\", \"surprise\", \"me\", \"with\", \"a\", \"lot\", \"of\", \"things\", \"I'm\", \"a\", \"nosey\", \"bitch\"."
32
  },
33
  {
34
+ "uid": "1b9e32b8-cf8e-42d6-bc08-292ad5857d67::B",
35
+ "audio_id": "1b9e32b8-cf8e-42d6-bc08-292ad5857d67",
36
+ "audio": "audio/1b9e32b8-cf8e-42d6-bc08-292ad5857d67.mp3",
37
+ "duration_sec": 5.32,
38
  "system": "B",
39
+ "description": "The utterance \"But he was trying to make a surprise party and I knew all about it, and he was trying to surprise me with a lot of things, and I'm a nosy bitch\" is delivered by a female speaker with a natural, conversational rhythm. The words \"But,\" \"he,\" \"was,\" \"trying,\" \"to,\" \"make,\" \"a,\" \"surprise,\" \"party,\" \"and,\" \"I,\" \"knew,\" \"all,\" \"about,\" \"it,\" \"and,\" \"he,\" \"was,\" \"trying,\" \"to,\" \"surprise,\" \"me,\" \"with,\" \"a,\" \"lot,\" \"of,\" \"things,\" \"and,\" \"I'm,\" \"a,\" \"nosy,\" \"bitch\" are spoken with consistent stress on the first syllable of each word, except for the unstressed syllables in \"surprise,\" \"party,\" \"knew,\" \"all,\" \"about,\" \"it,\" \"trying,\" \"surprise,\" \"me,\" \"things,\" \"nosy,\" and \"bitch,\" which are delivered with reduced pitch and duration, indicating unstressed phonemes."
40
  },
41
  {
42
+ "uid": "91eb5cf6-e889-495e-81b6-8756eb629e59::A",
43
+ "audio_id": "91eb5cf6-e889-495e-81b6-8756eb629e59",
44
+ "audio": "audio/91eb5cf6-e889-495e-81b6-8756eb629e59.mp3",
45
+ "duration_sec": 2.36,
46
  "system": "A",
47
+ "description": "Lexical and semantic content analysis of the sentence reveals the presence of the word 'Forfar' once."
48
  },
49
  {
50
+ "uid": "91eb5cf6-e889-495e-81b6-8756eb629e59::B",
51
+ "audio_id": "91eb5cf6-e889-495e-81b6-8756eb629e59",
52
+ "audio": "audio/91eb5cf6-e889-495e-81b6-8756eb629e59.mp3",
53
+ "duration_sec": 2.36,
54
  "system": "B",
55
+ "description": "A male speaker with a high-pitched, loud voice delivers the sentence \"East Fife, for, forfar\" at a slow pace, with clear articulation and deliberate pauses between \"for\" and \"forfar,\" where the word \"forfar\" is pronounced with a distinct, slightly elongated vowel sound and a rising intonation at the end."
56
  },
57
  {
58
+ "uid": "85ca4722-71ec-47dd-b3e2-8337d376a513::A",
59
+ "audio_id": "85ca4722-71ec-47dd-b3e2-8337d376a513",
60
+ "audio": "audio/85ca4722-71ec-47dd-b3e2-8337d376a513.mp3",
61
+ "duration_sec": 7.48,
62
  "system": "A",
63
+ "description": "was, panel"
64
  },
65
  {
66
+ "uid": "85ca4722-71ec-47dd-b3e2-8337d376a513::B",
67
+ "audio_id": "85ca4722-71ec-47dd-b3e2-8337d376a513",
68
+ "audio": "audio/85ca4722-71ec-47dd-b3e2-8337d376a513.mp3",
69
+ "duration_sec": 7.48,
70
  "system": "B",
71
+ "description": "The speaker, an older man with a slow, deliberate speaking rate and low volume, says \"I was working on a vegetable truck for three dollars a week,\" with clear stress on the word \"was\" and an unstressed version of the same phoneme in \"a\" at the end of \"three dollars a week,\" where the vowel is reduced and less prominent."
72
  },
73
  {
74
+ "uid": "7e68bc7b-2ab8-48a9-88db-bcc7b2e0dd5e::A",
75
+ "audio_id": "7e68bc7b-2ab8-48a9-88db-bcc7b2e0dd5e",
76
+ "audio": "audio/7e68bc7b-2ab8-48a9-88db-bcc7b2e0dd5e.mp3",
77
+ "duration_sec": 2.82,
78
  "system": "A",
79
+ "description": "Key words: \"Watergate scandal\", \"brought down\", \"president\"."
80
  },
81
  {
82
+ "uid": "7e68bc7b-2ab8-48a9-88db-bcc7b2e0dd5e::B",
83
+ "audio_id": "7e68bc7b-2ab8-48a9-88db-bcc7b2e0dd5e",
84
+ "audio": "audio/7e68bc7b-2ab8-48a9-88db-bcc7b2e0dd5e.mp3",
85
+ "duration_sec": 2.82,
86
  "system": "B",
87
+ "description": "A female speaker with a clear, steady articulation and moderate speaking rate delivers the utterance: \"The Watergate scandal brought down a huge president.\" The phrase \"Watergate scandal\" is spoken with emphasis on \"scandal,\" and \"brought down a huge president\" is delivered with a rising intonation on \"huge,\" suggesting significance. The speaker's tone conveys seriousness and urgency, and the word \"huge\" is stressed and elongated, indicating a strong emotional weight. The mention of \"huge president\" is spoken with a slight pause before and after, emphasizing the phrase. The speaker's accent is neutral American, and the delivery is fluent with no disfluencies."
88
  },
89
  {
90
+ "uid": "54d927bb-d3ef-42c7-b09c-25f94ccf252e::A",
91
+ "audio_id": "54d927bb-d3ef-42c7-b09c-25f94ccf252e",
92
+ "audio": "audio/54d927bb-d3ef-42c7-b09c-25f94ccf252e.mp3",
93
+ "duration_sec": 6.78,
94
  "system": "A",
95
+ "description": "red threads"
96
  },
97
  {
98
+ "uid": "54d927bb-d3ef-42c7-b09c-25f94ccf252e::B",
99
+ "audio_id": "54d927bb-d3ef-42c7-b09c-25f94ccf252e",
100
+ "audio": "audio/54d927bb-d3ef-42c7-b09c-25f94ccf252e.mp3",
101
+ "duration_sec": 6.78,
102
  "system": "B",
103
+ "description": "A young female speaker with a high-pitched, loud voice delivers the utterance \"Fred Thruffles 35: Fine threads of finer threads than Fred Thruffles 35 thick threads\" at a normal speaking rate, with clear articulation and emphasis on \"Fine\" at the beginning of the sentence, followed by a brief pause before \"thick threads\" is spoken."
104
  },
105
  {
106
+ "uid": "427ba822-c000-4303-bf21-7da0a703efc2::A",
107
+ "audio_id": "427ba822-c000-4303-bf21-7da0a703efc2",
108
+ "audio": "audio/427ba822-c000-4303-bf21-7da0a703efc2.mp3",
109
+ "duration_sec": 2.54,
110
  "system": "A",
111
+ "description": "Lexical & Semantic Content: The sentence contains the word 'attention' twice."
112
  },
113
  {
114
+ "uid": "427ba822-c000-4303-bf21-7da0a703efc2::B",
115
+ "audio_id": "427ba822-c000-4303-bf21-7da0a703efc2",
116
+ "audio": "audio/427ba822-c000-4303-bf21-7da0a703efc2.mp3",
117
+ "duration_sec": 2.54,
118
  "system": "B",
119
+ "description": "A young female speaker with a high-pitched, natural tone delivers the sentence \"Detention helped Rita's attention retention\" at a normal speaking rate, with clear articulation and no disfluencies; the word \"attention\" is spoken once, with a slight emphasis on the first syllable and a rising intonation at the end of the sentence."
120
  },
121
  {
122
+ "uid": "ed934345-29e0-4511-b12f-a66d160b9fd5::A",
123
+ "audio_id": "ed934345-29e0-4511-b12f-a66d160b9fd5",
124
+ "audio": "audio/ed934345-29e0-4511-b12f-a66d160b9fd5.mp3",
125
+ "duration_sec": 5.65,
126
  "system": "A",
127
+ "description": "the speaker mentions \"the first half of the century\" which implies a time period spanning the first half of a century. This suggests the event is from the twentieth century."
128
  },
129
  {
130
+ "uid": "ed934345-29e0-4511-b12f-a66d160b9fd5::B",
131
+ "audio_id": "ed934345-29e0-4511-b12f-a66d160b9fd5",
132
+ "audio": "audio/ed934345-29e0-4511-b12f-a66d160b9fd5.mp3",
133
+ "duration_sec": 5.65,
134
  "system": "B",
135
+ "description": "An older male speaker with a clear, steady articulation and moderate speaking rate states, \"The Poronynian Massacre was one of the most horrific events of the 20th century,\" emphasizing \"20th century\" with a slight pause before and after, indicating deliberate stress on the time frame."
136
  },
137
  {
138
+ "uid": "3c4fa8f8-972a-4dcb-a24b-e5d1039dd23f::A",
139
+ "audio_id": "3c4fa8f8-972a-4dcb-a24b-e5d1039dd23f",
140
+ "audio": "audio/3c4fa8f8-972a-4dcb-a24b-e5d1039dd23f.mp3",
141
+ "duration_sec": 2.73,
142
  "system": "A",
143
+ "description": "tracy's"
144
  },
145
  {
146
+ "uid": "3c4fa8f8-972a-4dcb-a24b-e5d1039dd23f::B",
147
+ "audio_id": "3c4fa8f8-972a-4dcb-a24b-e5d1039dd23f",
148
+ "audio": "audio/3c4fa8f8-972a-4dcb-a24b-e5d1039dd23f.mp3",
149
+ "duration_sec": 2.73,
150
  "system": "B",
151
+ "description": "A male speaker with a normal pitch and high volume delivers the sentence \"Tracy's truancy tricked teachers\" at a slow pace, with clear articulation and no disfluencies. The word \"Tracy's\" is pronounced with a slight emphasis on \"Tracy,\" followed by a brief pause before \"truancy,\" which is spoken with a steady rhythm and moderate stress. The word \"teachers\" follows immediately after \"truancy,\" with a slight rise in pitch and a clear, distinct pronunciation, indicating it is the second word in the utterance."
152
  },
153
  {
154
+ "uid": "fec3402e-7883-45c0-90d4-38647f615dc3::A",
155
+ "audio_id": "fec3402e-7883-45c0-90d4-38647f615dc3",
156
+ "audio": "audio/fec3402e-7883-45c0-90d4-38647f615dc3.mp3",
157
+ "duration_sec": 4.2,
158
  "system": "A",
159
+ "description": "Lexical & Semantic Content: The words \"really\" and \"really\" are both stressed in the utterance. Prosody & Delivery: The stress on \"really\" is evident in the pitch and rhythm of the speech."
160
  },
161
  {
162
+ "uid": "fec3402e-7883-45c0-90d4-38647f615dc3::B",
163
+ "audio_id": "fec3402e-7883-45c0-90d4-38647f615dc3",
164
+ "audio": "audio/fec3402e-7883-45c0-90d4-38647f615dc3.mp3",
165
+ "duration_sec": 4.2,
166
  "system": "B",
167
+ "description": "A male speaker with a low pitch and normal volume delivers the utterance \"What was I saying, how could I put it, without really--\" at a slow pace. The word \"saying\" is pronounced with a stressed vowel, while \"really\" is spoken with an unstressed vowel, both exhibiting a similar phonetic quality in their vowel sounds."
168
  }
169
  ]
170
  }
mos_core.py CHANGED
@@ -192,10 +192,7 @@ class Study:
192
 
193
  def stored_desc(self, state: Dict[str, Any], uid: str) -> Dict[str, Any]:
194
  row = state.get("desc_answers", {}).get(uid) or {}
195
- return {
196
- "score": row.get("score"),
197
- "listened": bool(row.get("listened")),
198
- }
199
 
200
  def stored_aspects(self, state: Dict[str, Any], uid: str) -> List[str]:
201
  row = state.get("aspect_answers", {}).get(uid) or {}
@@ -206,24 +203,18 @@ class Study:
206
  state: Dict[str, Any],
207
  score_left: Any,
208
  score_right: Any,
209
- listened: Any,
210
  step: int,
211
  ) -> Tuple[Dict[str, Any], str]:
212
  if state.get("phase") != "desc":
213
  return state, ""
214
  trial = state["desc_trials"][int(state["desc_idx"])]
215
  scores = [_coerce_score(score_left), _coerce_score(score_right)]
216
- heard = bool(listened)
217
  for uid, score in zip(trial["uids"], scores):
218
  state["desc_answers"][uid] = {
219
  "score": score,
220
- "listened": heard,
221
- "complete": heard and score is not None,
222
  }
223
  if step > 0:
224
- if not heard:
225
- self.save_partial(state)
226
- return state, "请先完整听完音频,再打分。"
227
  if any(score is None for score in scores):
228
  self.save_partial(state)
229
  return state, "请给两段描述都打分。"
@@ -396,14 +387,13 @@ def run_self_check() -> None:
396
  for item in study.desc["items"]:
397
  assert set(item) <= allowed
398
  assert item["system"] in {"A", "B"}
 
399
  public_aspect = json.loads((ROOT / "data" / "aspect_items.json").read_text(encoding="utf-8"))
400
  for item in public_aspect["items"]:
401
  assert "answer" not in item and "aspects" not in item
402
  with tempfile.TemporaryDirectory() as tmp:
403
  scratch = Study(ROOT, Path(tmp))
404
- blocked, message = scratch.move_desc(
405
- scratch.new_session("discard-me", seed=1), None, None, False, 1
406
- )
407
  assert message and blocked["desc_idx"] == 0
408
  state = scratch.new_session("self-check", seed=7)
409
  assert scratch.load_partial("self-check")["seed"] == 7
@@ -411,7 +401,7 @@ def run_self_check() -> None:
411
  assert shown_first == {"A", "B"}
412
  error = ""
413
  while state["phase"] == "desc":
414
- state, error = scratch.move_desc(state, 4, 5, True, 1)
415
  assert error == "", error
416
  while state["phase"] == "aspect":
417
  state, error = scratch.move_aspect(state, ["6", "1"], 1)
@@ -423,7 +413,7 @@ def run_self_check() -> None:
423
  assert len(saved[0]["description_ratings"]) == 20
424
  assert {row["score"] for row in saved[0]["description_ratings"]} == {4, 5}
425
  assert saved[0]["aspect_ratings"][0]["selected"] == ["1", "6"]
426
- state, error = scratch.move_desc(state, 5, 5, True, 1)
427
  assert state["phase"] == "done"
428
  assert len(ratings.read_text(encoding="utf-8").splitlines()) == 1
429
  print(
 
192
 
193
  def stored_desc(self, state: Dict[str, Any], uid: str) -> Dict[str, Any]:
194
  row = state.get("desc_answers", {}).get(uid) or {}
195
+ return {"score": row.get("score")}
 
 
 
196
 
197
  def stored_aspects(self, state: Dict[str, Any], uid: str) -> List[str]:
198
  row = state.get("aspect_answers", {}).get(uid) or {}
 
203
  state: Dict[str, Any],
204
  score_left: Any,
205
  score_right: Any,
 
206
  step: int,
207
  ) -> Tuple[Dict[str, Any], str]:
208
  if state.get("phase") != "desc":
209
  return state, ""
210
  trial = state["desc_trials"][int(state["desc_idx"])]
211
  scores = [_coerce_score(score_left), _coerce_score(score_right)]
 
212
  for uid, score in zip(trial["uids"], scores):
213
  state["desc_answers"][uid] = {
214
  "score": score,
215
+ "complete": score is not None,
 
216
  }
217
  if step > 0:
 
 
 
218
  if any(score is None for score in scores):
219
  self.save_partial(state)
220
  return state, "请给两段描述都打分。"
 
387
  for item in study.desc["items"]:
388
  assert set(item) <= allowed
389
  assert item["system"] in {"A", "B"}
390
+ assert float(item["duration_sec"]) <= 10.0
391
  public_aspect = json.loads((ROOT / "data" / "aspect_items.json").read_text(encoding="utf-8"))
392
  for item in public_aspect["items"]:
393
  assert "answer" not in item and "aspects" not in item
394
  with tempfile.TemporaryDirectory() as tmp:
395
  scratch = Study(ROOT, Path(tmp))
396
+ blocked, message = scratch.move_desc(scratch.new_session("discard-me", seed=1), None, None, 1)
 
 
397
  assert message and blocked["desc_idx"] == 0
398
  state = scratch.new_session("self-check", seed=7)
399
  assert scratch.load_partial("self-check")["seed"] == 7
 
401
  assert shown_first == {"A", "B"}
402
  error = ""
403
  while state["phase"] == "desc":
404
+ state, error = scratch.move_desc(state, 4, 5, 1)
405
  assert error == "", error
406
  while state["phase"] == "aspect":
407
  state, error = scratch.move_aspect(state, ["6", "1"], 1)
 
413
  assert len(saved[0]["description_ratings"]) == 20
414
  assert {row["score"] for row in saved[0]["description_ratings"]} == {4, 5}
415
  assert saved[0]["aspect_ratings"][0]["selected"] == ["1", "6"]
416
+ state, error = scratch.move_desc(state, 5, 5, 1)
417
  assert state["phase"] == "done"
418
  assert len(ratings.read_text(encoding="utf-8").splitlines()) == 1
419
  print(
prepare_mos_data.py CHANGED
@@ -107,6 +107,7 @@ def parse_args() -> argparse.Namespace:
107
  parser.add_argument("--n-desc", type=int, default=10, help="Paired audios per system.")
108
  parser.add_argument("--n-aspect", type=int, default=10)
109
  parser.add_argument("--bitrate", type=int, default=192_000, help="MP3 bitrate for web playback.")
 
110
  return parser.parse_args()
111
 
112
 
@@ -141,6 +142,18 @@ def parse_aspects(text: str) -> List[str]:
141
  return found
142
 
143
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  def transcode_mp3(src: Path, dst: Path, bit_rate: int) -> float:
145
  import av
146
 
@@ -183,17 +196,23 @@ def write_json(path: Path, payload: Any) -> None:
183
  path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
184
 
185
 
186
- def select_description_pairs(n: int, seed: int, bit_rate: int) -> Dict[str, Any]:
187
  baseline_rows = {row["id"]: row for row in load_json(BASELINE_JSON) if row.get("task") == "speech"}
188
  ours_rows = {row["id"]: row for row in load_json(OURS_JSON) if row.get("task") == "speech"}
189
  candidates = []
 
190
  for sample_id in sorted(set(baseline_rows) & set(ours_rows)):
191
  baseline_desc = str(baseline_rows[sample_id].get("perceiver_description") or "").strip()
192
  ours_desc = str(ours_rows[sample_id].get("perceiver_description") or "").strip()
193
  audio_path = resolve_audio(str(baseline_rows[sample_id].get("audio_id") or ""))
194
  if not baseline_desc or not ours_desc or audio_path is None:
195
  continue
 
 
 
 
196
  candidates.append(sample_id)
 
197
  if len(candidates) < n:
198
  raise RuntimeError(f"Only {len(candidates)} usable speech pairs; need {n}.")
199
 
@@ -247,6 +266,7 @@ def select_description_pairs(n: int, seed: int, bit_rate: int) -> Dict[str, Any]
247
  "public": {
248
  "task": "description_accuracy",
249
  "subset": "speech",
 
250
  "seed": seed,
251
  "n_audios": n,
252
  "playback": f"{bit_rate // 1000} kbps MP3 transcoded from the original wav",
@@ -314,7 +334,13 @@ def main() -> None:
314
  "Old ratings stay aligned only while these stimulus ids are unchanged."
315
  )
316
 
317
- desc = select_description_pairs(args.n_desc, args.seed, args.bitrate)
 
 
 
 
 
 
318
  aspect = select_aspect_items(args.n_aspect, args.seed)
319
  created = datetime.now(timezone.utc).isoformat()
320
 
 
107
  parser.add_argument("--n-desc", type=int, default=10, help="Paired audios per system.")
108
  parser.add_argument("--n-aspect", type=int, default=10)
109
  parser.add_argument("--bitrate", type=int, default=192_000, help="MP3 bitrate for web playback.")
110
+ parser.add_argument("--max-duration", type=float, default=10.0, help="Keep speech clips no longer than this many seconds.")
111
  return parser.parse_args()
112
 
113
 
 
142
  return found
143
 
144
 
145
+ def audio_duration(path: Path) -> float:
146
+ import av
147
+
148
+ with av.open(str(path)) as container:
149
+ if container.duration:
150
+ return float(container.duration) / 1_000_000
151
+ stream = container.streams.audio[0]
152
+ if stream.duration:
153
+ return float(stream.duration * stream.time_base)
154
+ return 0.0
155
+
156
+
157
  def transcode_mp3(src: Path, dst: Path, bit_rate: int) -> float:
158
  import av
159
 
 
196
  path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
197
 
198
 
199
+ def select_description_pairs(n: int, seed: int, bit_rate: int, max_duration: float) -> Dict[str, Any]:
200
  baseline_rows = {row["id"]: row for row in load_json(BASELINE_JSON) if row.get("task") == "speech"}
201
  ours_rows = {row["id"]: row for row in load_json(OURS_JSON) if row.get("task") == "speech"}
202
  candidates = []
203
+ too_long = 0
204
  for sample_id in sorted(set(baseline_rows) & set(ours_rows)):
205
  baseline_desc = str(baseline_rows[sample_id].get("perceiver_description") or "").strip()
206
  ours_desc = str(ours_rows[sample_id].get("perceiver_description") or "").strip()
207
  audio_path = resolve_audio(str(baseline_rows[sample_id].get("audio_id") or ""))
208
  if not baseline_desc or not ours_desc or audio_path is None:
209
  continue
210
+ duration = audio_duration(audio_path)
211
+ if duration <= 0 or duration > max_duration:
212
+ too_long += 1
213
+ continue
214
  candidates.append(sample_id)
215
+ print(f"Speech pairs at most {max_duration:.0f}s: {len(candidates)} (excluded {too_long} longer clips)")
216
  if len(candidates) < n:
217
  raise RuntimeError(f"Only {len(candidates)} usable speech pairs; need {n}.")
218
 
 
266
  "public": {
267
  "task": "description_accuracy",
268
  "subset": "speech",
269
+ "max_duration_sec": max_duration,
270
  "seed": seed,
271
  "n_audios": n,
272
  "playback": f"{bit_rate // 1000} kbps MP3 transcoded from the original wav",
 
334
  "Old ratings stay aligned only while these stimulus ids are unchanged."
335
  )
336
 
337
+ desc = select_description_pairs(args.n_desc, args.seed, args.bitrate, args.max_duration)
338
+ keep = {item["audio"] for item in desc["public"]["items"]}
339
+ audio_dir = MOS_DIR / "audio"
340
+ if audio_dir.is_dir():
341
+ for old in audio_dir.glob("*.mp3"):
342
+ if f"audio/{old.name}" not in keep:
343
+ old.unlink()
344
  aspect = select_aspect_items(args.n_aspect, args.seed)
345
  created = datetime.now(timezone.utc).isoformat()
346