ChristophSchuhmann commited on
Commit
4f4bae2
·
verified ·
1 Parent(s): 434e38f

Add paired 50-audio caption evaluation, measured durations and six reproducible Humaneness Voice training formats

Browse files
PROMPT_FORMAT.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Humaneness Voice caption and transcript format
2
+
3
+ This document defines the **default output contract** of Procedural Voice Captions.
4
+ The format identifier is `humaneness-general-script-v2-20261011`.
5
+ The shared conventions come from the [Humaneness Voice Small model](https://huggingface.co/laion/Humaneness-Voice-Small), its [timed annotation engine](https://huggingface.co/laion/Humaneness-Voice-Small/blob/main/code/anno_timed.py), and the [original prompting guide](https://laion-humaneness-voice-small-acting-eval-space.static.hf.space/index.html). The local original is the August 25, 2026 prompting schema; sentence durations in that guide use **square**, not round, brackets.
6
+
7
+ ## The two required sections
8
+
9
+ ```text
10
+ GENERAL: A quiet, soft-spoken delivery with a slightly breathy timbre and audible sadness.
11
+ SCRIPT:
12
+ (soft, restrained, sad) [2.10 seconds duration] I thought you might stay.
13
+ [0.40 seconds pause]
14
+ (Chuckle, 0.30 seconds)
15
+ [0.20 seconds pause]
16
+ (quiet, hesitant) [1.20 seconds duration] Just for tonight.
17
+ ```
18
+
19
+ The example spans 4.20 seconds. A production caption uses model predictions for its wording and measured ASR/detector endpoints for the numbers. This example is illustrative.
20
+
21
+ | Element | Exact syntax | Meaning |
22
+ |---|---|---|
23
+ | Global voice description | `GENERAL: ...` | Voice, delivery, affect and quality over the complete recording |
24
+ | Script section | `SCRIPT:` followed by lines | The spoken content, sentence delivery and vocal events |
25
+ | Delivery direction | `(soft, restrained, sad)` | How to perform the following spoken segment; no duration inside a direction |
26
+ | Spoken segment duration | `[2.10 seconds duration]` | The inclusive time budget of the following segment |
27
+ | Pause | `[0.40 seconds pause]` | A gap with no aligned speech or selected vocal event |
28
+ | Vocal burst | `(Chuckle, 0.30 seconds)` | An event label and its measured duration; never a bare label in the default timed output |
29
+
30
+ One duration is emitted for **every spoken segment**. A sentence can be split at a substantial pause, a vocal burst in a word gap, or a long segment boundary. Each ASR word appears exactly once, in its original order. This is not one clip-length duration prepended to an entire multi-sentence transcript.
31
+
32
+ ## Event endpoints and overlapping events
33
+
34
+ Every event also retains `start` and `end`, or `start_s` and `end_s`, in the JSON, relative to the complete recording. The displayed event duration comes from `end − start`; it is not guessed from the event class.
35
+
36
+ The historical guide allowed speech-overlapping bursts to become bare labels. The current default instead retains **all selected event durations**, as requested for training. This requires an explicit extension to the old timing rules:
37
+
38
+ ```text
39
+ (strained, hesitant) [1.00 seconds duration] I (Breath, 0.30 seconds) know.
40
+ ```
41
+
42
+ Here the breath happens **inside** the one-second segment. It is an annotation of a simultaneous event and does not make the segment 1.30 seconds long. A burst on its **own line** consumes additional timeline time. A burst inside a line that has a segment duration is included in that enclosing duration. A group of overlapping standalone bursts similarly uses one enclosing interval budget with all event lengths retained inside it.
43
+
44
+ This distinction is recorded in `script_timing.timeline`, `duration_includes_inline_events` and `overlap_policy`. The independent verifier parses this distinction from the emitted lines. Do not reuse an older verifier that blindly adds every numeric burst token to every enclosing duration; it would double-count simultaneous audio. The original Humaneness Small linear parser predates this extension. Plain and untimed inline transcripts remain available when adapting existing training consumers; the accompanying new parser is the timing contract for the duration-rich output.
45
+
46
+ Raw detections, selected detections, class softmax probabilities, actual endpoints and all original acoustic scores remain available. Formatting does not establish that a candidate event is truly audible.
47
+
48
+ ## Pauses, rounding and verification
49
+
50
+ Gaps of at least 0.20 seconds receive pause markers. Smaller gaps are included in adjacent speech budgets. If neither neighbour is speech, a small gap is printed rather than added to a burst's duration. A pause means no aligned foreground speech or selected vocal event; a recording can still contain background sound.
51
+
52
+ Numbers have two decimal places. Segment budgets are differences of rounded absolute endpoints, so rounding cannot accumulate drift. The independent parser checks the elapsed timeline against the recording length, the complete word sequence, and one numeric duration per selected burst. Strict default generation raises `TimingUnavailable` when the available alignment cannot establish a valid script; it does **not** silently substitute an untimed prompt. `timed=False` is an explicit opt-in to historical untimed output.
53
+
54
+ ASR unsupported for a language is different from silence. Listening pages show the absence of verified alignment explicitly and keep any original corpus text separate. They must not invent sentence timestamps for that text.
55
+
56
+ ## Regenerate from saved predictions
57
+
58
+ ```python
59
+ import json
60
+ from refresh_saved_caption import refresh_saved_caption
61
+ from humaneness_caption_settings import load_settings
62
+
63
+ settings = load_settings()
64
+ baseline = json.load(open(settings["normalization_file"]))
65
+ record = json.load(open("saved_annotation.json"))
66
+ updated = refresh_saved_caption(record, baseline, settings)
67
+ print(updated["procedural_caption"])
68
+ assert updated["timed_ok"]
69
+ ```
70
+
71
+ This runs no ASR or neural model. It reuses the stored global and sentence predictions and measured word/event endpoints. The default settings and normalizer are versioned in this repository. Nine wording variants, when exported, share the same audio, timestamps, event selection and verified script; they are not nine independent acoustic annotations.
72
+
73
+ `render_timed(..., duration_style="round")` also supports `(2.10 seconds duration)` when a caller explicitly requests it. The default follows the source guide's `[2.10 seconds duration]` grammar.
74
+
75
+ ## MOSS `CAPTION` / `TRANSCRIPT` training surfaces
76
+
77
+ The same dataset can provide the other Humaneness Voice Small prompt surface:
78
+
79
+ ```text
80
+ CAPTION: A softly spoken, hesitant voice with a breathy delivery.
81
+ TRANSCRIPT: "[2.10 seconds duration] I thought you might stay.
82
+ [0.40 seconds pause]
83
+ (Chuckle, 0.30 seconds)
84
+ [0.20 seconds pause]
85
+ [1.20 seconds duration] Just for tonight."
86
+ ```
87
+
88
+ For this surface, `CAPTION` starts with the **MOSS whole-audio caption**. A separate variant appends chronological MOSS burst descriptions with start/end times. `TRANSCRIPT` can be plain ASR text, text with `(Label, duration seconds)` event annotations, or the verified timed script. These variants are exported separately, so a training reader can choose a surface without reconstructing it or discarding the original annotations. Burst timestamps come from Humaneness Ears; the burst prose comes from the interval-conditioned MOSS adapter, which receives the complete audio and both endpoints.
89
+
90
+ Original voice identifiers, language, acting challenge, source revision, directions, scripts, API model identifiers and generation settings stay in the dataset metadata. Credentials are not dataset metadata and are excluded.
91
+
92
+ Original documentation: CC BY 4.0, LAION.
README.md CHANGED
@@ -114,3 +114,18 @@ All values are **0–5 automated audio-reviewer scores**, not human benchmark sc
114
  The separate original-50 listening review scored **3.94 whole-caption / 3.68 burst-caption / 3.71 location**, with 141 intervals. That is a different sample set and protocol, not a paired improvement claim.
115
 
116
  [Complete recommendations, grid, scoring rubric and limitations](RECOMMENDED_SETTINGS.md) · [Machine-readable settings](recommended_settings.json) · [Detailed decoding results](evaluation/locator_decoding_pilot.json) · [Separate procedural-caption tuning](evaluation/procedural_caption_pilot.json).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  The separate original-50 listening review scored **3.94 whole-caption / 3.68 burst-caption / 3.71 location**, with 141 intervals. That is a different sample set and protocol, not a paired improvement claim.
115
 
116
  [Complete recommendations, grid, scoring rubric and limitations](RECOMMENDED_SETTINGS.md) · [Machine-readable settings](recommended_settings.json) · [Detailed decoding results](evaluation/locator_decoding_pilot.json) · [Separate procedural-caption tuning](evaluation/procedural_caption_pilot.json).
117
+
118
+ ## Timed training surfaces and same-audio comparison
119
+
120
+ ▶ **[50 audios: MOSS versus procedural captions, with six selectable CAPTION/TRANSCRIPT variants](https://laion-moss-voice-acting-captions.static.hf.space/format-comparison.html)**
121
+
122
+ Both captioners were rerun on the same 50 complete recordings using greedy decoding, locator threshold 0.6, 0.08-s minimum duration, suppression at half the shorter interval and **no selected-event cap**. Intended script, scenario and emotion labels were withheld. A blinded automated audio review used the same five-part rubric for both pipelines.
123
+
124
+ | Pipeline | Composite / 5 | Global fidelity | Burst description | Timing | Event precision rating | Event recall rating |
125
+ |---|---:|---:|---:|---:|---:|---:|
126
+ | MOSS, greedy and uncapped | 3.863 | 4.34 | 3.72 | 3.46 | 3.50 | 4.14 |
127
+ | Procedural, compact tags | 2.704 | 2.74 | 2.02 | 3.04 | 3.06 | 3.10 |
128
+
129
+ These are Gemini audio-judge ratings, **not human scores or precision/recall percentages**. The 25-clip confirmation composites are 3.646 for MOSS and 2.760 for procedural captions. Overall procedural compact tags tied the previous prose. The earlier original-50 scores and twenty-clip tuning use different protocols; do not compare their numbers as a measured improvement. [Frozen metrics and rubric](evaluation/prompt-format-20261011.json).
130
+
131
+ `training_formats.py` combines the unchanged whole-audio caption, optionally followed by interval-conditioned burst descriptions, with plain ASR, inline burst ASR or fully timed ASR. It creates six `CAPTION`/`TRANSCRIPT` choices. Every burst has both endpoints and a duration; overlapping durations are included within the enclosing segment budget, never counted twice. ASR is supplied separately by Parakeet v3. [Exact Humaneness Voice format](PROMPT_FORMAT.md) · [Humaneness Voice Small](https://huggingface.co/laion/Humaneness-Voice-Small) · [Procedural source](https://github.com/LAION-AI/procedural-voice-captions).
RECOMMENDED_SETTINGS.md CHANGED
@@ -67,7 +67,7 @@ Selection winner: **0.5 / greedy**, confirmed composite **3.55/5**. The 0.6 gree
67
 
68
  The earlier review covered **50 clips, 141 proposed events**, using a different listening selection (top three intervals, onset threshold 0.6). Whole captions averaged **3.94/5**, event captions **3.68/5**, and intervals **3.71/5**. That set contained 45 English and five German clips. These scores are not a paired before/after comparison with the twenty-clip search.
69
 
70
- ## Procedural caption default
71
 
72
  The deterministic procedural pipeline separately selected **0.7 + overlap suppression**, a speech-only reference of **80,265** Medium-scored clips (41,771 S10 + 38,494 multilingual Emilia), three distinctive VoiceNet phrases, up to two emotions with z ≥ +0.5, and a two-sentence template. Tempo is always included; demographic and authenticity wording is omitted while raw predictions remain saved. Content Enjoyment supplies pleasantness wording. Blend is a continuous regression target and never marks a clip burst-free.
73
 
@@ -83,3 +83,11 @@ The procedural composite has a different rubric (caption 30%, timing 25%, precis
83
  Machine-readable configuration and results are in `recommended_settings.json` and `evaluation/locator_decoding_pilot.json`; procedural results are in `evaluation/procedural_caption_pilot.json`. Raw numeric predictions and historical normalization are retained. The original-50 review plus all procedural and decoding review calls in the shared budget ledger have an estimated total list-price cost of **$0.5033**, within the $10 ceiling. This is an estimate from token usage, not a billing invoice.
84
 
85
  These scores come from an automated audio reviewer. Neither captions nor event boundaries were manually adjudicated. Small sample size, prior tuning on these sources, one sampling seed, and imperfect reviewer judgments limit generalization. Use the settings as a documented starting point and inspect events from your own domain.
 
 
 
 
 
 
 
 
 
67
 
68
  The earlier review covered **50 clips, 141 proposed events**, using a different listening selection (top three intervals, onset threshold 0.6). Whole captions averaged **3.94/5**, event captions **3.68/5**, and intervals **3.71/5**. That set contained 45 English and five German clips. These scores are not a paired before/after comparison with the twenty-clip search.
69
 
70
+ ## Historical procedural caption search
71
 
72
  The deterministic procedural pipeline separately selected **0.7 + overlap suppression**, a speech-only reference of **80,265** Medium-scored clips (41,771 S10 + 38,494 multilingual Emilia), three distinctive VoiceNet phrases, up to two emotions with z ≥ +0.5, and a two-sentence template. Tempo is always included; demographic and authenticity wording is omitted while raw predictions remain saved. Content Enjoyment supplies pleasantness wording. Blend is a continuous regression target and never marks a clip burst-free.
73
 
 
83
  Machine-readable configuration and results are in `recommended_settings.json` and `evaluation/locator_decoding_pilot.json`; procedural results are in `evaluation/procedural_caption_pilot.json`. Raw numeric predictions and historical normalization are retained. The original-50 review plus all procedural and decoding review calls in the shared budget ledger have an estimated total list-price cost of **$0.5033**, within the $10 ceiling. This is an estimate from token usage, not a billing invoice.
84
 
85
  These scores come from an automated audio reviewer. Neither captions nor event boundaries were manually adjudicated. Small sample size, prior tuning on these sources, one sampling seed, and imperfect reviewer judgments limit generalization. Use the settings as a documented starting point and inspect events from your own domain.
86
+
87
+ ## Current procedural format and paired 50-audio review
88
+
89
+ Current procedural settings are threshold **0.7**, two VoiceNet properties, up to one emotion at z ≥ +0.5, compact tags and the same 80,265-clip speech reference. Every spoken segment and selected event has a numeric duration; pauses use square brackets. [Exact grammar and overlap policy](PROMPT_FORMAT.md).
90
+
91
+ On the same 50 recordings (45 EN, five DE), the shared audio-judge composite is **3.863/5 for uncapped greedy MOSS** and **2.704/5 for compact procedural captions**. Twenty-five recordings selected the procedural configuration, and twenty-five different recordings confirmed it. Compact tags tied previous prose overall; there is no demonstrated general wording-quality gain. These are automated reviewer ratings, not human benchmark metrics. This shared rubric differs from the earlier twenty-clip search.
92
+
93
+ [Listen to all 50 paired annotations and inspect six Humaneness Voice training formats](https://laion-moss-voice-acting-captions.static.hf.space/format-comparison.html) · [Complete paired metrics](evaluation/prompt-format-20261011.json) · [Procedural code and defaults](https://github.com/LAION-AI/procedural-voice-captions).
evaluation/prompt-format-20261011.json ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema": "paired-caption-format-review-v1",
3
+ "n": 50,
4
+ "languages": {
5
+ "en": 45,
6
+ "de": 5
7
+ },
8
+ "selection_n": 25,
9
+ "confirmation_n": 25,
10
+ "results_all50": [
11
+ {
12
+ "name": "Procedural \u00b7 compact tags",
13
+ "config_id": "guide-concise",
14
+ "n": 50,
15
+ "weighted_score": 2.7039999999999997,
16
+ "caption_fidelity": 2.74,
17
+ "burst_description_fidelity": 2.02,
18
+ "timing_accuracy": 3.04,
19
+ "event_precision": 3.06,
20
+ "event_recall": 3.1,
21
+ "readability": 2.48
22
+ },
23
+ {
24
+ "name": "Procedural \u00b7 previous prose",
25
+ "config_id": "reviewed-prose",
26
+ "n": 50,
27
+ "weighted_score": 2.7039999999999997,
28
+ "caption_fidelity": 2.74,
29
+ "burst_description_fidelity": 2.02,
30
+ "timing_accuracy": 3.04,
31
+ "event_precision": 3.06,
32
+ "event_recall": 3.1,
33
+ "readability": 2.54
34
+ },
35
+ {
36
+ "name": "MOSS \u00b7 greedy, uncapped",
37
+ "config_id": "moss",
38
+ "n": 50,
39
+ "weighted_score": 3.863,
40
+ "caption_fidelity": 4.34,
41
+ "burst_description_fidelity": 3.72,
42
+ "timing_accuracy": 3.46,
43
+ "event_precision": 3.5,
44
+ "event_recall": 4.14,
45
+ "readability": 4.24
46
+ }
47
+ ],
48
+ "confirmation": {
49
+ "mode": "confirmation",
50
+ "n_audio": 25,
51
+ "results": {
52
+ "guide-concise": {
53
+ "n": 25,
54
+ "weighted_score": 2.76,
55
+ "caption_fidelity": 2.88,
56
+ "burst_description_fidelity": 2.2,
57
+ "timing_accuracy": 2.96,
58
+ "event_precision": 3.0,
59
+ "event_recall": 3.04,
60
+ "readability": 2.56
61
+ },
62
+ "reviewed-prose": {
63
+ "n": 25,
64
+ "weighted_score": 2.772,
65
+ "caption_fidelity": 2.92,
66
+ "burst_description_fidelity": 2.2,
67
+ "timing_accuracy": 2.96,
68
+ "event_precision": 3.0,
69
+ "event_recall": 3.04,
70
+ "readability": 2.8
71
+ },
72
+ "moss": {
73
+ "n": 25,
74
+ "weighted_score": 3.6459999999999995,
75
+ "caption_fidelity": 4.08,
76
+ "burst_description_fidelity": 3.48,
77
+ "timing_accuracy": 3.36,
78
+ "event_precision": 3.36,
79
+ "event_recall": 3.76,
80
+ "readability": 3.96
81
+ }
82
+ },
83
+ "procedural_ranking": [
84
+ "reviewed-prose",
85
+ "guide-concise"
86
+ ],
87
+ "rubric": {
88
+ "caption_fidelity": 0.3,
89
+ "burst_description_fidelity": 0.25,
90
+ "timing_accuracy": 0.2,
91
+ "event_precision": 0.15,
92
+ "event_recall": 0.1
93
+ },
94
+ "scale": "0\u20135; independent integer scores from an automated audio reviewer",
95
+ "automated_judge_not_human_ground_truth": true,
96
+ "paired_same_audio_same_rubric": true,
97
+ "moss_event_cap": null,
98
+ "score_aggregation": "Clip mean, equally weighted recordings",
99
+ "shared_budget_estimated_usd": 0.85162575,
100
+ "actual_model_versions": [
101
+ "gemini-3.8-flash"
102
+ ]
103
+ },
104
+ "selection": {
105
+ "mode": "selection",
106
+ "n_audio": 25,
107
+ "results": {
108
+ "guide-concise": {
109
+ "n": 25,
110
+ "weighted_score": 2.648,
111
+ "caption_fidelity": 2.6,
112
+ "burst_description_fidelity": 1.84,
113
+ "timing_accuracy": 3.12,
114
+ "event_precision": 3.12,
115
+ "event_recall": 3.16,
116
+ "readability": 2.4
117
+ },
118
+ "guide-tags": {
119
+ "n": 25,
120
+ "weighted_score": 2.648,
121
+ "caption_fidelity": 2.6,
122
+ "burst_description_fidelity": 1.84,
123
+ "timing_accuracy": 3.12,
124
+ "event_precision": 3.12,
125
+ "event_recall": 3.16,
126
+ "readability": 2.4
127
+ },
128
+ "moss": {
129
+ "n": 25,
130
+ "weighted_score": 4.08,
131
+ "caption_fidelity": 4.6,
132
+ "burst_description_fidelity": 3.96,
133
+ "timing_accuracy": 3.56,
134
+ "event_precision": 3.64,
135
+ "event_recall": 4.52,
136
+ "readability": 4.52
137
+ },
138
+ "guide-precision": {
139
+ "n": 25,
140
+ "weighted_score": 2.17,
141
+ "caption_fidelity": 2.6,
142
+ "burst_description_fidelity": 1.48,
143
+ "timing_accuracy": 2.4,
144
+ "event_precision": 2.48,
145
+ "event_recall": 1.68,
146
+ "readability": 2.36
147
+ },
148
+ "reviewed-prose": {
149
+ "n": 25,
150
+ "weighted_score": 2.636,
151
+ "caption_fidelity": 2.56,
152
+ "burst_description_fidelity": 1.84,
153
+ "timing_accuracy": 3.12,
154
+ "event_precision": 3.12,
155
+ "event_recall": 3.16,
156
+ "readability": 2.28
157
+ }
158
+ },
159
+ "procedural_ranking": [
160
+ "guide-concise",
161
+ "guide-tags",
162
+ "reviewed-prose",
163
+ "guide-precision"
164
+ ],
165
+ "rubric": {
166
+ "caption_fidelity": 0.3,
167
+ "burst_description_fidelity": 0.25,
168
+ "timing_accuracy": 0.2,
169
+ "event_precision": 0.15,
170
+ "event_recall": 0.1
171
+ },
172
+ "scale": "0\u20135; independent integer scores from an automated audio reviewer",
173
+ "automated_judge_not_human_ground_truth": true,
174
+ "paired_same_audio_same_rubric": true,
175
+ "moss_event_cap": null,
176
+ "score_aggregation": "Clip mean, equally weighted recordings",
177
+ "shared_budget_estimated_usd": 0.70739325,
178
+ "actual_model_versions": [
179
+ "gemini-3.8-flash"
180
+ ]
181
+ },
182
+ "bootstrap": [
183
+ {
184
+ "partition": "all",
185
+ "n": 50,
186
+ "mean_moss_minus_procedural": 1.1589999999999998,
187
+ "paired_bootstrap_95_ci": [
188
+ 0.9869999999999999,
189
+ 1.338
190
+ ]
191
+ },
192
+ {
193
+ "partition": "confirmation",
194
+ "n": 25,
195
+ "mean_moss_minus_procedural": 0.8859999999999998,
196
+ "paired_bootstrap_95_ci": [
197
+ 0.7219999999999999,
198
+ 1.0639999999999998
199
+ ]
200
+ }
201
+ ],
202
+ "selected_config": "guide-concise",
203
+ "selected_before_confirmation": true,
204
+ "moss_events": 360,
205
+ "procedural_events": 264,
206
+ "all_50_timed_formats_verified": true,
207
+ "training_variants_per_clip": 6,
208
+ "model_version": "gemini-3.8-flash",
209
+ "corpus_format_check": {
210
+ "format_id": "humaneness-general-script-v2-20261011",
211
+ "n": 38427,
212
+ "passed": 38427,
213
+ "old_timed_ok": 21961,
214
+ "errors": [],
215
+ "inline_overlapping_events": 171813,
216
+ "completed_epoch_s": 1791705077.8488383,
217
+ "rounding_repair": "Zero-budget sub-centisecond pause tags omitted; no word or burst interval altered"
218
+ },
219
+ "automated_review_not_human_ground_truth": true,
220
+ "rubric": {
221
+ "caption_fidelity": 0.3,
222
+ "burst_description_fidelity": 0.25,
223
+ "timing_accuracy": 0.2,
224
+ "event_precision": 0.15,
225
+ "event_recall": 0.1
226
+ }
227
+ }
prompt_format.py ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Evidence-based GENERAL/SCRIPT timing; independent of inference libraries.
2
+
3
+ Sequential events follow the Humaneness Voice timed guide. An inline burst is
4
+ a simultaneous annotation inside an inclusive segment budget, not extra elapsed
5
+ time. This explicit extension keeps every measured burst duration, including
6
+ speech-overlapping events that the historical guide rendered without numbers.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ import math
11
+ import re
12
+
13
+ FORMAT_ID = 'humaneness-general-script-v2-20261011'
14
+ PAUSE_MIN = 0.20
15
+ MAX_SEGMENT = 12.0
16
+ DURATION_STYLE = 'square'
17
+ _DURATION = re.compile(r'[\[(](\d+(?:\.\d+)?) seconds duration[\])]')
18
+ _PAUSE = re.compile(r'\[(\d+(?:\.\d+)?) seconds pause\]')
19
+ _BURST = re.compile(r'\(([^()]*?), (\d+(?:\.\d+)?) seconds\)')
20
+ _SENTENCE_END = re.compile(r'[.!?…][\"\'”’]*$')
21
+
22
+
23
+ class TimingUnavailable(ValueError):
24
+ """The input cannot establish timed spoken segments."""
25
+
26
+
27
+ def _label(value):
28
+ # Parentheses in directions would otherwise look like nested event tokens.
29
+ return re.sub(r'\s+', ' ', str(value or '').replace('(', '').replace(')', '')).strip()
30
+
31
+
32
+ def _duration_tag(value, style):
33
+ if style == 'square':
34
+ return f'[{value:.2f} seconds duration]'
35
+ if style == 'round':
36
+ return f'({value:.2f} seconds duration)'
37
+ raise ValueError('duration_style must be square or round')
38
+
39
+
40
+ def _chunks(words, events, sentences, pause_min):
41
+ """Assign each word exactly once; sentence boundaries are never inclusive twice."""
42
+ groups, lo = [], 0
43
+ for i, word in enumerate(words):
44
+ final = i == len(words) - 1
45
+ boundary = bool(_SENTENCE_END.search(word['w']))
46
+ if not final:
47
+ a, b = word['end'], words[i + 1]['start']
48
+ boundary |= b - a >= pause_min
49
+ boundary |= any(a <= e['start_s'] and e['end_s'] <= b for e in events)
50
+ boundary |= word['end'] - words[lo]['start'] >= MAX_SEGMENT
51
+ # ASR sometimes omits punctuation; use a supplied sentence boundary.
52
+ boundary |= any(a - 1e-6 <= s.get('end', -1) < b - 1e-6 for s in sentences
53
+ if isinstance(s.get('end'), (int, float)))
54
+ if final or boundary:
55
+ piece = words[lo:i + 1]
56
+ if piece[-1]['end'] <= piece[0]['start']:
57
+ if groups:
58
+ groups[-1]['words'].extend(piece)
59
+ groups[-1]['text'] = ' '.join(w['w'] for w in groups[-1]['words'])
60
+ else:
61
+ continue
62
+ else:
63
+ start, end = piece[0]['start'], max(w['end'] for w in piece)
64
+ candidates = [(max(0., min(end, s.get('end', end)) - max(start, s.get('start', start))), s)
65
+ for s in sentences if isinstance(s.get('start'), (int, float))
66
+ and isinstance(s.get('end'), (int, float))]
67
+ cue = max(candidates, key=lambda x: x[0])[1].get('caption', '') if candidates else ''
68
+ groups.append({'kind': 'speech', 'start_s': start, 'end_s': end,
69
+ 'words': piece, 'text': ' '.join(w['w'] for w in piece), 'cue': _label(cue)})
70
+ lo = i + 1
71
+ if words and ' '.join(g['text'] for g in groups) != ' '.join(w['w'] for w in words):
72
+ raise TimingUnavailable('A zero-duration word group cannot be timed without losing text')
73
+ return groups
74
+
75
+
76
+ def render_timed(sentences, words, bursts, duration_s, *, pause_min=PAUSE_MIN,
77
+ duration_style=DURATION_STYLE, include_cues=True):
78
+ """Return lines and an auditable plan, using measured word/event intervals.
79
+
80
+ Every selected burst is printed once with its full observed duration. If
81
+ intervals overlap, a containing duration budget includes the inline events;
82
+ it is never increased by their durations. Exact endpoints stay in the plan.
83
+ """
84
+ duration_s = float(duration_s)
85
+ if not math.isfinite(duration_s) or duration_s <= 0:
86
+ raise ValueError('Invalid audio duration')
87
+ if not words and any(str(row.get('text', '')).strip() for row in sentences or []):
88
+ raise TimingUnavailable('Spoken text is present without measured word intervals')
89
+ timed_words = []
90
+ for row in words or []:
91
+ if row.get('start') is None or row.get('end') is None or not row.get('w'):
92
+ raise TimingUnavailable('Every spoken token requires an onset and offset')
93
+ start, end = float(row['start']), float(row['end'])
94
+ if not math.isfinite(start + end) or start < 0 or end < start or end > duration_s + .051:
95
+ raise TimingUnavailable('Word interval is outside the supplied recording')
96
+ timed_words.append({**row, 'start': start, 'end': min(end, duration_s), 'w': str(row['w'])})
97
+ if any(a['start'] > b['start'] for a, b in zip(timed_words, timed_words[1:])):
98
+ raise TimingUnavailable('Word onsets are not in chronological order')
99
+ events = []
100
+ for index, row in enumerate(bursts or []):
101
+ start = float(row.get('start_s', row.get('start', -1)))
102
+ end = float(row.get('end_s', row.get('end', -1)))
103
+ if not math.isfinite(start + end) or not 0 <= start < end <= duration_s + .001:
104
+ raise ValueError('Burst requires valid start AND end seconds')
105
+ label = _label(row.get('written') or row.get('label') or 'Vocal Burst')
106
+ events.append({'kind': 'burst', 'start_s': start, 'end_s': min(end, duration_s),
107
+ 'label': label, 'event_index': index, 'duration_s': min(end, duration_s) - start})
108
+ groups = _chunks(timed_words, events, sentences or [], pause_min)
109
+ if not groups and timed_words:
110
+ raise TimingUnavailable('No positive-duration spoken interval')
111
+ # Connected interval components handle overlap without double-counting time.
112
+ components = []
113
+ for item in sorted(groups + events, key=lambda x: (x['start_s'], x['end_s'], x['kind'])):
114
+ if components and item['start_s'] < components[-1]['end_s'] - 1e-7:
115
+ components[-1]['items'].append(item)
116
+ components[-1]['end_s'] = max(components[-1]['end_s'], item['end_s'])
117
+ else:
118
+ components.append({'start_s': item['start_s'], 'end_s': item['end_s'], 'items': [item]})
119
+ plan = []
120
+ for component in components:
121
+ speech = sorted((i for i in component['items'] if i['kind'] == 'speech'), key=lambda x: x['start_s'])
122
+ local_events = sorted((i for i in component['items'] if i['kind'] == 'burst'), key=lambda x: x['start_s'])
123
+ if speech:
124
+ cuts = [component['start_s']]
125
+ cuts.extend((a['end_s'] + b['start_s']) / 2 for a, b in zip(speech, speech[1:]))
126
+ cuts.append(component['end_s'])
127
+ attached = [[] for _ in speech]
128
+ for event in local_events:
129
+ best = max(range(len(speech)), key=lambda j:
130
+ max(0., min(event['end_s'], speech[j]['end_s']) - max(event['start_s'], speech[j]['start_s'])))
131
+ attached[best].append(event)
132
+ for j, group in enumerate(speech):
133
+ plan.append({**group, 'start_s': cuts[j], 'end_s': cuts[j + 1], 'inline_events': attached[j],
134
+ 'duration_includes_inline_events': True})
135
+ elif len(local_events) == 1:
136
+ plan.append({**local_events[0], 'inline_events': []})
137
+ else:
138
+ plan.append({'kind': 'burst_group', 'start_s': component['start_s'], 'end_s': component['end_s'],
139
+ 'inline_events': local_events, 'duration_includes_inline_events': True,
140
+ 'cue': 'overlapping non-speech vocal events', 'text': ''})
141
+ # Small gaps are included in a neighbouring speech budget; burst lengths are
142
+ # never changed to absorb silence or compensate for rounding.
143
+ timeline, cursor = [], 0.
144
+ for item in plan:
145
+ item = dict(item)
146
+ gap = item['start_s'] - cursor
147
+ if gap > 1e-7:
148
+ if gap + 1e-7 < pause_min and item['kind'] == 'speech':
149
+ item['start_s'] = cursor
150
+ elif gap + 1e-7 < pause_min and timeline and timeline[-1]['kind'] == 'speech':
151
+ timeline[-1]['end_s'] = item['start_s']
152
+ else:
153
+ timeline.append({'kind': 'pause', 'start_s': cursor, 'end_s': item['start_s']})
154
+ timeline.append(item)
155
+ cursor = item['end_s']
156
+ tail = duration_s - cursor
157
+ if tail > 1e-7:
158
+ if tail + 1e-7 < pause_min and timeline and timeline[-1]['kind'] == 'speech':
159
+ timeline[-1]['end_s'] = duration_s
160
+ else:
161
+ timeline.append({'kind': 'pause', 'start_s': cursor, 'end_s': duration_s})
162
+ lines = []
163
+ for item in timeline:
164
+ # Difference of rounded boundaries telescopes to the rounded clip length.
165
+ budget = round(item['end_s'], 2) - round(item['start_s'], 2)
166
+ if budget <= 0:
167
+ if item['kind'] == 'pause':
168
+ continue # sub-centisecond gap has zero displayed timeline budget
169
+ raise TimingUnavailable('A timeline interval is smaller than display precision')
170
+ if item['kind'] == 'pause':
171
+ lines.append(f'[{budget:.2f} seconds pause]')
172
+ elif item['kind'] == 'burst':
173
+ lines.append(f"({item['label']}, {budget:.2f} seconds)")
174
+ else:
175
+ inline = sorted(item['inline_events'], key=lambda e: (e['start_s'], e['event_index']))
176
+ parts, i = [], 0
177
+ for word in item.get('words', []):
178
+ while i < len(inline) and (inline[i]['start_s'] + inline[i]['end_s']) / 2 <= word['start']:
179
+ e = inline[i]; parts.append(f"({e['label']}, {e['duration_s']:.2f} seconds)"); i += 1
180
+ parts.append(word['w'])
181
+ for e in inline[i:]:
182
+ parts.append(f"({e['label']}, {e['duration_s']:.2f} seconds)")
183
+ cue = f"({item['cue']}) " if include_cues and item.get('cue') else ''
184
+ lines.append(cue + _duration_tag(budget, duration_style) + ' ' + ' '.join(parts))
185
+ transcript = ' '.join(w['w'] for w in timed_words)
186
+ errors = verify_timed('\n'.join(lines), transcript, duration_s, expected_bursts=len(events))
187
+ if errors:
188
+ raise TimingUnavailable('; '.join(errors))
189
+ audit = {'format_id': FORMAT_ID, 'duration_style': duration_style, 'pause_min_s': pause_min,
190
+ 'timing_source': 'stored ASR word endpoints and detector event endpoints',
191
+ 'n_words': len(timed_words), 'n_bursts': len(events),
192
+ 'n_inline_overlapping_events': sum(len(x.get('inline_events', [])) for x in timeline),
193
+ 'n_speech_segments': sum(x['kind'] == 'speech' for x in timeline),
194
+ 'timeline': [{k: v for k, v in x.items() if k not in {'words', 'cue'}} for x in timeline],
195
+ 'numeric_budget_s': numeric_budget('\n'.join(lines)),
196
+ 'verified': True, 'transcript_reference': 'all ASR words, each exactly once',
197
+ 'overlap_policy': 'Inline durations are included in the enclosing segment budget, not added again'}
198
+ return lines, audit
199
+
200
+
201
+ def numeric_budget(script):
202
+ """Parse printed budgets only; no renderer state or original time intervals."""
203
+ total = 0.
204
+ for line in script.splitlines():
205
+ durations = _DURATION.findall(line)
206
+ total += sum(float(x) for x in durations) + sum(float(x) for x in _PAUSE.findall(line))
207
+ if not durations:
208
+ total += sum(float(x[1]) for x in _BURST.findall(line))
209
+ return total
210
+
211
+
212
+ def verify_timed(script, transcript, duration_s, *, expected_bursts=None):
213
+ errors = []
214
+ if abs(numeric_budget(script) - float(duration_s)) > .015:
215
+ errors.append('printed timeline does not match audio duration')
216
+ stripped = re.sub(r'\[[^\]]*\]', ' ', script)
217
+ stripped = re.sub(r'\([^()]*\)', ' ', stripped)
218
+ if ' '.join(stripped.split()) != ' '.join((transcript or '').split()):
219
+ errors.append('transcript words were lost, duplicated or reordered')
220
+ if expected_bursts is not None and len(_BURST.findall(script)) != expected_bursts:
221
+ errors.append('some selected bursts are missing a numeric duration')
222
+ for line in script.splitlines():
223
+ if line.strip() and not (_DURATION.search(line) or _PAUSE.fullmatch(line.strip()) or _BURST.fullmatch(line.strip())):
224
+ errors.append('a script line has no duration or valid pause tag')
225
+ return errors
226
+
227
+
228
+ def format_record(result, *, duration_style=DURATION_STYLE, include_cues=True):
229
+ """Update the prompt surface from stored inference; no ASR/model call."""
230
+ bursts = [dict(e, label=e.get('written') or e.get('label')) for e in result.get('variant_a_bursts', [])]
231
+ lines, audit = render_timed(result.get('sentences', []), result.get('words', []), bursts,
232
+ result['dur'], duration_style=duration_style, include_cues=include_cues)
233
+ result.update(script_timed=lines, timed_ok=True, script_timing=audit, prompt_format_id=FORMAT_ID)
234
+ return 'GENERAL: ' + result['global_caption'] + '\nSCRIPT:\n' + '\n'.join(lines)
recommended_settings.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "schema": "moss-and-procedural-recommendations-v1",
3
  "date": "2026-10-11",
4
  "moss": {
5
  "selected_config": {
@@ -212,7 +212,8 @@
212
  "combined_selected_score": 3.5700000000000003,
213
  "same_20_clips_as_moss_pilot": true,
214
  "caption_templates_are_deterministic_not_temperature_sampled": true,
215
- "blend_is_not_a_detector": true
 
216
  },
217
  "original_50_listening_review": {
218
  "n_clips": 50,
@@ -227,5 +228,256 @@
227
  "not_paired_with_20_clip_search": true
228
  },
229
  "total_shared_judge_estimated_usd": 0.50333025,
230
- "automated_judge_not_human_ground_truth": true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  }
 
1
  {
2
+ "schema": "moss-and-procedural-recommendations-v2",
3
  "date": "2026-10-11",
4
  "moss": {
5
  "selected_config": {
 
212
  "combined_selected_score": 3.5700000000000003,
213
  "same_20_clips_as_moss_pilot": true,
214
  "caption_templates_are_deterministic_not_temperature_sampled": true,
215
+ "blend_is_not_a_detector": true,
216
+ "historical_not_current_default": true
217
  },
218
  "original_50_listening_review": {
219
  "n_clips": 50,
 
228
  "not_paired_with_20_clip_search": true
229
  },
230
  "total_shared_judge_estimated_usd": 0.50333025,
231
+ "automated_judge_not_human_ground_truth": true,
232
+ "procedural_current_default": {
233
+ "id": "guide-concise",
234
+ "normalization": "speech",
235
+ "threshold": 0.7,
236
+ "kv": 2,
237
+ "ke": 1,
238
+ "template": "tags",
239
+ "nms": true,
240
+ "audible_only": true,
241
+ "normalization_file": "baseline_stats_humaneness_medium_speech.json",
242
+ "baseline_sha256": "c96503622619f63528a12ddcb28b19d4beddff7d94522d11b6a83dabad654f43",
243
+ "nms_overlap_fraction": 0.5,
244
+ "min_duration_s": 0.08,
245
+ "min_emotion_z": 0.5,
246
+ "omit_demographic_wording": true,
247
+ "omit_genuineness_wording": true,
248
+ "blend_is_not_a_detector": true,
249
+ "format_id": "humaneness-general-script-v2-20261011",
250
+ "duration_style": "square",
251
+ "pause_min_s": 0.2,
252
+ "timing_mode": "verified_always",
253
+ "overlap_duration_policy": "Full duration on each inline event; included in its enclosing segment budget",
254
+ "selection_evidence": "evaluations/prompt-format-20261011.json"
255
+ },
256
+ "paired_50_format_review": {
257
+ "schema": "paired-caption-format-review-v1",
258
+ "n": 50,
259
+ "languages": {
260
+ "en": 45,
261
+ "de": 5
262
+ },
263
+ "selection_n": 25,
264
+ "confirmation_n": 25,
265
+ "results_all50": [
266
+ {
267
+ "name": "Procedural \u00b7 compact tags",
268
+ "config_id": "guide-concise",
269
+ "n": 50,
270
+ "weighted_score": 2.7039999999999997,
271
+ "caption_fidelity": 2.74,
272
+ "burst_description_fidelity": 2.02,
273
+ "timing_accuracy": 3.04,
274
+ "event_precision": 3.06,
275
+ "event_recall": 3.1,
276
+ "readability": 2.48
277
+ },
278
+ {
279
+ "name": "Procedural \u00b7 previous prose",
280
+ "config_id": "reviewed-prose",
281
+ "n": 50,
282
+ "weighted_score": 2.7039999999999997,
283
+ "caption_fidelity": 2.74,
284
+ "burst_description_fidelity": 2.02,
285
+ "timing_accuracy": 3.04,
286
+ "event_precision": 3.06,
287
+ "event_recall": 3.1,
288
+ "readability": 2.54
289
+ },
290
+ {
291
+ "name": "MOSS \u00b7 greedy, uncapped",
292
+ "config_id": "moss",
293
+ "n": 50,
294
+ "weighted_score": 3.863,
295
+ "caption_fidelity": 4.34,
296
+ "burst_description_fidelity": 3.72,
297
+ "timing_accuracy": 3.46,
298
+ "event_precision": 3.5,
299
+ "event_recall": 4.14,
300
+ "readability": 4.24
301
+ }
302
+ ],
303
+ "confirmation": {
304
+ "mode": "confirmation",
305
+ "n_audio": 25,
306
+ "results": {
307
+ "guide-concise": {
308
+ "n": 25,
309
+ "weighted_score": 2.76,
310
+ "caption_fidelity": 2.88,
311
+ "burst_description_fidelity": 2.2,
312
+ "timing_accuracy": 2.96,
313
+ "event_precision": 3.0,
314
+ "event_recall": 3.04,
315
+ "readability": 2.56
316
+ },
317
+ "reviewed-prose": {
318
+ "n": 25,
319
+ "weighted_score": 2.772,
320
+ "caption_fidelity": 2.92,
321
+ "burst_description_fidelity": 2.2,
322
+ "timing_accuracy": 2.96,
323
+ "event_precision": 3.0,
324
+ "event_recall": 3.04,
325
+ "readability": 2.8
326
+ },
327
+ "moss": {
328
+ "n": 25,
329
+ "weighted_score": 3.6459999999999995,
330
+ "caption_fidelity": 4.08,
331
+ "burst_description_fidelity": 3.48,
332
+ "timing_accuracy": 3.36,
333
+ "event_precision": 3.36,
334
+ "event_recall": 3.76,
335
+ "readability": 3.96
336
+ }
337
+ },
338
+ "procedural_ranking": [
339
+ "reviewed-prose",
340
+ "guide-concise"
341
+ ],
342
+ "rubric": {
343
+ "caption_fidelity": 0.3,
344
+ "burst_description_fidelity": 0.25,
345
+ "timing_accuracy": 0.2,
346
+ "event_precision": 0.15,
347
+ "event_recall": 0.1
348
+ },
349
+ "scale": "0\u20135; independent integer scores from an automated audio reviewer",
350
+ "automated_judge_not_human_ground_truth": true,
351
+ "paired_same_audio_same_rubric": true,
352
+ "moss_event_cap": null,
353
+ "score_aggregation": "Clip mean, equally weighted recordings",
354
+ "shared_budget_estimated_usd": 0.85162575,
355
+ "actual_model_versions": [
356
+ "gemini-3.8-flash"
357
+ ]
358
+ },
359
+ "selection": {
360
+ "mode": "selection",
361
+ "n_audio": 25,
362
+ "results": {
363
+ "guide-concise": {
364
+ "n": 25,
365
+ "weighted_score": 2.648,
366
+ "caption_fidelity": 2.6,
367
+ "burst_description_fidelity": 1.84,
368
+ "timing_accuracy": 3.12,
369
+ "event_precision": 3.12,
370
+ "event_recall": 3.16,
371
+ "readability": 2.4
372
+ },
373
+ "guide-tags": {
374
+ "n": 25,
375
+ "weighted_score": 2.648,
376
+ "caption_fidelity": 2.6,
377
+ "burst_description_fidelity": 1.84,
378
+ "timing_accuracy": 3.12,
379
+ "event_precision": 3.12,
380
+ "event_recall": 3.16,
381
+ "readability": 2.4
382
+ },
383
+ "moss": {
384
+ "n": 25,
385
+ "weighted_score": 4.08,
386
+ "caption_fidelity": 4.6,
387
+ "burst_description_fidelity": 3.96,
388
+ "timing_accuracy": 3.56,
389
+ "event_precision": 3.64,
390
+ "event_recall": 4.52,
391
+ "readability": 4.52
392
+ },
393
+ "guide-precision": {
394
+ "n": 25,
395
+ "weighted_score": 2.17,
396
+ "caption_fidelity": 2.6,
397
+ "burst_description_fidelity": 1.48,
398
+ "timing_accuracy": 2.4,
399
+ "event_precision": 2.48,
400
+ "event_recall": 1.68,
401
+ "readability": 2.36
402
+ },
403
+ "reviewed-prose": {
404
+ "n": 25,
405
+ "weighted_score": 2.636,
406
+ "caption_fidelity": 2.56,
407
+ "burst_description_fidelity": 1.84,
408
+ "timing_accuracy": 3.12,
409
+ "event_precision": 3.12,
410
+ "event_recall": 3.16,
411
+ "readability": 2.28
412
+ }
413
+ },
414
+ "procedural_ranking": [
415
+ "guide-concise",
416
+ "guide-tags",
417
+ "reviewed-prose",
418
+ "guide-precision"
419
+ ],
420
+ "rubric": {
421
+ "caption_fidelity": 0.3,
422
+ "burst_description_fidelity": 0.25,
423
+ "timing_accuracy": 0.2,
424
+ "event_precision": 0.15,
425
+ "event_recall": 0.1
426
+ },
427
+ "scale": "0\u20135; independent integer scores from an automated audio reviewer",
428
+ "automated_judge_not_human_ground_truth": true,
429
+ "paired_same_audio_same_rubric": true,
430
+ "moss_event_cap": null,
431
+ "score_aggregation": "Clip mean, equally weighted recordings",
432
+ "shared_budget_estimated_usd": 0.70739325,
433
+ "actual_model_versions": [
434
+ "gemini-3.8-flash"
435
+ ]
436
+ },
437
+ "bootstrap": [
438
+ {
439
+ "partition": "all",
440
+ "n": 50,
441
+ "mean_moss_minus_procedural": 1.1589999999999998,
442
+ "paired_bootstrap_95_ci": [
443
+ 0.9869999999999999,
444
+ 1.338
445
+ ]
446
+ },
447
+ {
448
+ "partition": "confirmation",
449
+ "n": 25,
450
+ "mean_moss_minus_procedural": 0.8859999999999998,
451
+ "paired_bootstrap_95_ci": [
452
+ 0.7219999999999999,
453
+ 1.0639999999999998
454
+ ]
455
+ }
456
+ ],
457
+ "selected_config": "guide-concise",
458
+ "selected_before_confirmation": true,
459
+ "moss_events": 360,
460
+ "procedural_events": 264,
461
+ "all_50_timed_formats_verified": true,
462
+ "training_variants_per_clip": 6,
463
+ "model_version": "gemini-3.8-flash",
464
+ "corpus_format_check": {
465
+ "format_id": "humaneness-general-script-v2-20261011",
466
+ "n": 38427,
467
+ "passed": 38427,
468
+ "old_timed_ok": 21961,
469
+ "errors": [],
470
+ "inline_overlapping_events": 171813,
471
+ "completed_epoch_s": 1791705077.8488383,
472
+ "rounding_repair": "Zero-budget sub-centisecond pause tags omitted; no word or burst interval altered"
473
+ },
474
+ "automated_review_not_human_ground_truth": true,
475
+ "rubric": {
476
+ "caption_fidelity": 0.3,
477
+ "burst_description_fidelity": 0.25,
478
+ "timing_accuracy": 0.2,
479
+ "event_precision": 0.15,
480
+ "event_recall": 0.1
481
+ }
482
+ }
483
  }
training_formats.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Selectable MOSS CAPTION/TRANSCRIPT surfaces for Humaneness Voice training."""
2
+ from prompt_format import render_timed, _DURATION
3
+
4
+
5
+ def _quote(text):
6
+ # Preserve real newlines in the training surface; escape literal quotation
7
+ # marks/backslashes so the boundary of the transcript remains unambiguous.
8
+ return '"' + text.replace('\\', '\\\\').replace('"', '\\"') + '"'
9
+
10
+
11
+ def moss_training_formats(procedural, moss):
12
+ """Six complete, reproducible choices; no model invocation or text invention."""
13
+ whole = moss['voice_caption']['prediction']
14
+ bursts = []
15
+ descriptions = []
16
+ for i, event in enumerate(moss['burst_captions']):
17
+ start, end = event['start_s'], event['end_s']
18
+ top = event['top3_classes'][0]
19
+ written = top['label'] if top['softmax_probability'] >= .5 else 'Vocal Burst'
20
+ bursts.append({'start_s':start, 'end_s':end, 'label':written})
21
+ descriptions.append(f"Event {i+1}, {start:.2f}–{end:.2f} s ({end-start:.2f} s): {event['caption']['prediction']}")
22
+ appended = whole + ('\nVocal events:\n' + '\n'.join(descriptions) if descriptions else '\nNo vocal-event intervals selected by this locator configuration.')
23
+ lines, proof = render_timed([], procedural['words'], bursts, moss['audio_duration_s'], include_cues=False)
24
+ transcripts = {
25
+ 'plain':procedural['transcript'],
26
+ 'inline_bursts':'\n'.join(_DURATION.sub('', line).strip() for line in lines),
27
+ 'timed':'\n'.join(lines),
28
+ }
29
+ variants = {}
30
+ for kind, caption in [('whole_audio_only', whole), ('with_burst_descriptions', appended)]:
31
+ for surface, transcript in transcripts.items():
32
+ name = kind + '__' + surface
33
+ variants[name] = {
34
+ 'caption':caption, 'transcript':transcript,
35
+ 'prompt':'CAPTION: ' + caption + '\nTRANSCRIPT: ' + _quote(transcript),
36
+ 'caption_source':'MOSS whole-audio adapter' + (' + interval-conditioned burst adapter' if kind=='with_burst_descriptions' else ''),
37
+ 'transcript_source':'Parakeet v3 ASR' if surface=='plain' else 'Parakeet v3 word sequence + Humaneness Ears event intervals',
38
+ 'appended_burst_descriptions':kind=='with_burst_descriptions',
39
+ 'burst_tags_in_transcript':surface!='plain',
40
+ 'segment_durations_in_transcript':surface=='timed',
41
+ 'locator_settings':moss['locator_settings'],
42
+ }
43
+ return {'schema':'humaneness-moss-caption-transcript-variants-v1', 'variants':variants,
44
+ 'timed_transcript_verification':proof,
45
+ 'plain_transcript_verbatim':True,
46
+ 'whole_audio_only_note':'Original whole-audio prose is unchanged and can itself mention vocal events; only appended event captions are omitted.',
47
+ 'inline_bursts_note':'Speech-segment duration tags are omitted; measured burst durations and pause markers are retained.',
48
+ 'pairing_note':'All MOSS transcript event tags use the same locator intervals as the MOSS burst-caption list, independently of the procedural locator threshold.'}