ErenJaegerYeager commited on
Commit
4b8d886
·
verified ·
1 Parent(s): d324d88

Upload folder using huggingface_hub

Browse files
CITATION.cff ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ cff-version: 1.2.0
2
+ message: "If you use MDU-RiskText or MDU-RiskBench, please cite this dataset and the PriVTE paper."
3
+ title: "MDU-RiskText and MDU-RiskBench"
4
+ type: dataset
5
+ authors:
6
+ - name: "PriVTE Authors"
7
+ version: "1.0.0"
8
+ date-released: "2026-07-28"
9
+ repository-code: "https://github.com/Herrieson/privte-public"
LICENSE_DATA.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MDU-RiskText / MDU-RiskBench Data Terms
2
+
3
+ Copyright (c) 2026 PriVTE contributors.
4
+
5
+ Permission is granted to use, reproduce, and redistribute the released
6
+ MDU-RiskText and MDU-RiskBench files for research, education, evaluation, and
7
+ non-commercial development, provided that users:
8
+
9
+ 1. cite the dataset and PriVTE paper;
10
+ 2. do not attempt to identify or contact participants or institutions;
11
+ 3. do not combine the records with external data for re-identification;
12
+ 4. do not use the data or derived systems for automated punishment,
13
+ disciplinary action, eligibility denial, or individual surveillance; and
14
+ 5. preserve these terms and the dataset attribution in redistributions.
15
+
16
+ The data are provided as-is, without warranty. These terms cover the dataset
17
+ records and benchmark metadata; separately released source code may use a
18
+ different software license.
MANIFEST.json ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "mdu_risk_huggingface_release_manifest.v1",
3
+ "release_version": "1.0.0",
4
+ "participant_count": 850,
5
+ "selected_source_video_count": 9831,
6
+ "settings": [
7
+ "video_only",
8
+ "non_video_only",
9
+ "all_filtered_text"
10
+ ],
11
+ "split_counts": {
12
+ "train": 593,
13
+ "validation": 131,
14
+ "test": 126
15
+ },
16
+ "label_counts": {
17
+ "no_observed_risk": 226,
18
+ "mild_risk": 432,
19
+ "moderate_risk": 172,
20
+ "high_risk": 20
21
+ },
22
+ "files": [
23
+ {
24
+ "path": "CITATION.cff",
25
+ "bytes": 316,
26
+ "sha256": "e60eeab531e9b8556bbd95ad16e8198c802261d16d0ebd3c1a79491001881f4c"
27
+ },
28
+ {
29
+ "path": "LICENSE_DATA.md",
30
+ "bytes": 860,
31
+ "sha256": "4731d9956f0900820af455d36015a7b7b63c19b4b52a378741661224b2620c74"
32
+ },
33
+ {
34
+ "path": "MDU-RiskBench/README.md",
35
+ "bytes": 759,
36
+ "sha256": "5c94c9a26d85f7a80eec2fbb2b9b043305d7e47ffadca8c84abf54648c6efc07"
37
+ },
38
+ {
39
+ "path": "MDU-RiskBench/benchmark.json",
40
+ "bytes": 1453,
41
+ "sha256": "9b8a1b0f223d8ebc557c95829991decd5af18f059e48da076ad65a7a183c661a"
42
+ },
43
+ {
44
+ "path": "MDU-RiskBench/participants.jsonl.gz",
45
+ "bytes": 7467,
46
+ "sha256": "6bc074886abe1c6e309cf10e94ca8ac7969d0a0473a92f77e73888d8547e8173",
47
+ "rows": 850
48
+ },
49
+ {
50
+ "path": "MDU-RiskBench/prediction.schema.json",
51
+ "bytes": 764,
52
+ "sha256": "5207d5befc52e95cae52cd01825ff0019b978ffbbf831d73097f725c1b9309be"
53
+ },
54
+ {
55
+ "path": "MDU-RiskBench/reference_results/direct_video_comparison.csv",
56
+ "bytes": 324,
57
+ "sha256": "a1031b9f7cd54aa1b4132250686e3b6d92fb24b5a4bde9878efd10c173da6608"
58
+ },
59
+ {
60
+ "path": "MDU-RiskBench/reference_results/direct_video_comparison.json",
61
+ "bytes": 797,
62
+ "sha256": "acec89ae7074ad5d3cf7c4ac86432d2594d10dd87b9f396a2e8cc2458fc15f76"
63
+ },
64
+ {
65
+ "path": "MDU-RiskBench/reference_results/llm_full_matrix.csv",
66
+ "bytes": 1296,
67
+ "sha256": "e1c3a88e1d758ab438c9ea004533c48bd0db6917c89414a123cbbf06e6ec08de"
68
+ },
69
+ {
70
+ "path": "MDU-RiskBench/reference_results/llm_full_matrix.json",
71
+ "bytes": 3913,
72
+ "sha256": "cb9b08127d27525251fce3278f75cc7cba91d150b7b0583856bd70cde8bc7266"
73
+ },
74
+ {
75
+ "path": "MDU-RiskBench/reference_results/llm_setting_means.csv",
76
+ "bytes": 391,
77
+ "sha256": "06580cfc9fe94b50c4269361941dbc835c59be5767d10c1fcac83725627d6683"
78
+ },
79
+ {
80
+ "path": "MDU-RiskBench/reference_results/llm_setting_means.json",
81
+ "bytes": 972,
82
+ "sha256": "0a4b37af4ab6ece03ca730fbab174afcd1fc8044aa5d611ab6cdabc8690d0673"
83
+ },
84
+ {
85
+ "path": "MDU-RiskBench/reference_results/trained_video_only_baselines.csv",
86
+ "bytes": 356,
87
+ "sha256": "3a746a0ea3acbda8e122dc353a8e2e907077d4692f1cefd652ac9ee6a97ea129"
88
+ },
89
+ {
90
+ "path": "MDU-RiskBench/reference_results/trained_video_only_baselines.json",
91
+ "bytes": 1067,
92
+ "sha256": "fe5cc83e5a219b658d71f92081e397ed73245563b5ed3c0a13c2f888caa8b5d9"
93
+ },
94
+ {
95
+ "path": "MDU-RiskText/README.md",
96
+ "bytes": 934,
97
+ "sha256": "510f3ae71076f421e29d826b9512c8ea39418053afb10f98fc529c97fdee960f"
98
+ },
99
+ {
100
+ "path": "MDU-RiskText/all_filtered_text/test.jsonl.gz",
101
+ "bytes": 452994,
102
+ "sha256": "50840c1ddc3fc76ebe21814cf2b41865644830ea21fa20e1a293e15c173439e4",
103
+ "rows": 126
104
+ },
105
+ {
106
+ "path": "MDU-RiskText/all_filtered_text/train.jsonl.gz",
107
+ "bytes": 2099999,
108
+ "sha256": "6046f11a57db90a140ecb9e1f1d81c9182277d97f3ae9c9b139c080df5f8a1ca",
109
+ "rows": 593
110
+ },
111
+ {
112
+ "path": "MDU-RiskText/all_filtered_text/validation.jsonl.gz",
113
+ "bytes": 480862,
114
+ "sha256": "4ed49e171f093761671416ff060da0f1242a56eb38c2e42773170d2810ec44e4",
115
+ "rows": 131
116
+ },
117
+ {
118
+ "path": "MDU-RiskText/non_video_only/test.jsonl.gz",
119
+ "bytes": 32918,
120
+ "sha256": "4044b80e11222672f8f0c31c1f74e6e86fd1f97a758f869e2e92257c3eec4fd3",
121
+ "rows": 126
122
+ },
123
+ {
124
+ "path": "MDU-RiskText/non_video_only/train.jsonl.gz",
125
+ "bytes": 139533,
126
+ "sha256": "8a95077c2d8e95a1cb5e20a5b5c9c954853a942bbff01cdc5a815ad25201164a",
127
+ "rows": 593
128
+ },
129
+ {
130
+ "path": "MDU-RiskText/non_video_only/validation.jsonl.gz",
131
+ "bytes": 34139,
132
+ "sha256": "a8bbdeecd60c97e9a800f5a4c8c027c63966208e512165ec28daed7557991fcb",
133
+ "rows": 131
134
+ },
135
+ {
136
+ "path": "MDU-RiskText/record.schema.json",
137
+ "bytes": 1164,
138
+ "sha256": "760713b21f391c0f876a8b038c6b06872d4ea23c8243c8de3cd8948f55869bad"
139
+ },
140
+ {
141
+ "path": "MDU-RiskText/video_only/test.jsonl.gz",
142
+ "bytes": 260025,
143
+ "sha256": "09d1de11c631057e2c675ffc905070659aa7476659129406fa553edac6982013",
144
+ "rows": 126
145
+ },
146
+ {
147
+ "path": "MDU-RiskText/video_only/train.jsonl.gz",
148
+ "bytes": 1175832,
149
+ "sha256": "3dce8f876a5d1b190ee2963b6dcf7f754091c73b18c51ed24f3addf1b2c7ebd3",
150
+ "rows": 593
151
+ },
152
+ {
153
+ "path": "MDU-RiskText/video_only/validation.jsonl.gz",
154
+ "bytes": 274850,
155
+ "sha256": "d9be520041a74fa35669171e4ae863f2cac83a218c458164b2d096706cd383fb",
156
+ "rows": 131
157
+ },
158
+ {
159
+ "path": "README.md",
160
+ "bytes": 4855,
161
+ "sha256": "115f9f2b26bbbb9f4e683b0e1afaa916a79e42089fef782cfaa9476812c4f745"
162
+ },
163
+ {
164
+ "path": "scripts/build_release.py",
165
+ "bytes": 30862,
166
+ "sha256": "26603875fc69b9e2d6c5b73be2721f30a4391444593454f2968df9b5a280666b"
167
+ },
168
+ {
169
+ "path": "scripts/evaluate_predictions.py",
170
+ "bytes": 2927,
171
+ "sha256": "415f25e6bd395b420911c01b4a2ad253aefea8fee8568e821e4b4e7e3ca57696"
172
+ },
173
+ {
174
+ "path": "scripts/verify_release.py",
175
+ "bytes": 3005,
176
+ "sha256": "48ebf393e9ff5c392f4ff20cafbaab04c9ca1f3faeaed8dbed41fb3d9a499104"
177
+ }
178
+ ]
179
+ }
MDU-RiskBench/README.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MDU-RiskBench
2
+
3
+ MDU-RiskBench is the benchmark definition paired with MDU-RiskText. It
4
+ contains:
5
+
6
+ - `benchmark.json`: cohort, labels, settings, and metric definitions;
7
+ - `participants.jsonl.gz`: the frozen 850-participant index;
8
+ - `prediction.schema.json`: submission record contract;
9
+ - `reference_results/`: aggregate result tables when available;
10
+ - `../scripts/evaluate_predictions.py`: reference evaluator;
11
+ - `../scripts/verify_release.py`: integrity and alignment validator.
12
+
13
+ A prediction JSONL contains one object per participant:
14
+
15
+ ```json
16
+ {"sample_id":"MDURT_000001","risk_level":"mild_risk"}
17
+ ```
18
+
19
+ Models may additionally output `confidence`, evidence references, rationale,
20
+ and review flags; the reference evaluator uses `sample_id` and `risk_level`.
MDU-RiskBench/benchmark.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "mdu_riskbench.v1",
3
+ "name": "MDU-RiskBench",
4
+ "paired_dataset": "MDU-RiskText v1",
5
+ "task": "Text-only Youth Digital Use Risk Screening",
6
+ "participant_count": 850,
7
+ "selected_source_video_count": 9831,
8
+ "participant_disjoint_splits": true,
9
+ "split_counts": {
10
+ "train": 593,
11
+ "validation": 131,
12
+ "test": 126
13
+ },
14
+ "ordinal_labels": [
15
+ "no_observed_risk",
16
+ "mild_risk",
17
+ "moderate_risk",
18
+ "high_risk"
19
+ ],
20
+ "abstention_label": "insufficient_evidence",
21
+ "label_counts": {
22
+ "no_observed_risk": 226,
23
+ "mild_risk": 432,
24
+ "moderate_risk": 172,
25
+ "high_risk": 20
26
+ },
27
+ "headline_settings": {
28
+ "video_only": "PriVTE privacy-filtered video-to-text evidence",
29
+ "non_video_only": "coarse app-category, heart-rate-bin, and questionnaire-risk text",
30
+ "all_filtered_text": "PriVTE evidence plus coarse auxiliary text"
31
+ },
32
+ "primary_metrics": [
33
+ "accuracy",
34
+ "macro_f1",
35
+ "ordinal_mae",
36
+ "ordinal_rmse",
37
+ "coverage"
38
+ ],
39
+ "ordinal_metric_policy": "MAE and RMSE are computed on predictions in the four ordinal labels; insufficient_evidence is reported through coverage.",
40
+ "source_video_selection": {
41
+ "maximum_selected_per_participant": 12,
42
+ "selection": "uniform_over_ordered_source_inventory",
43
+ "minimum_video_stream_duration_seconds": 4.0,
44
+ "all_selected_files_must_pass_technical_validation": true,
45
+ "replacement_after_selected_file_failure": false
46
+ }
47
+ }
MDU-RiskBench/participants.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bc074886abe1c6e309cf10e94ca8ac7969d0a0473a92f77e73888d8547e8173
3
+ size 7467
MDU-RiskBench/prediction.schema.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "MDU-RiskBench prediction record",
4
+ "type": "object",
5
+ "required": [
6
+ "sample_id",
7
+ "risk_level"
8
+ ],
9
+ "properties": {
10
+ "sample_id": {
11
+ "type": "string",
12
+ "pattern": "^MDURT_[0-9]{6}$"
13
+ },
14
+ "risk_level": {
15
+ "enum": [
16
+ "no_observed_risk",
17
+ "mild_risk",
18
+ "moderate_risk",
19
+ "high_risk",
20
+ "insufficient_evidence"
21
+ ]
22
+ },
23
+ "confidence": {
24
+ "enum": [
25
+ "low",
26
+ "medium",
27
+ "high"
28
+ ]
29
+ },
30
+ "evidence_used": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "string"
34
+ }
35
+ },
36
+ "needs_human_review": {
37
+ "type": "boolean"
38
+ }
39
+ },
40
+ "additionalProperties": true
41
+ }
MDU-RiskBench/reference_results/direct_video_comparison.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ input,model,participants,accuracy,macro_f1,coverage,selective_ordinal_mae,selective_within_one,elevated_recall
2
+ direct_video,Keye-VL-1.5-8B,704,0.1747,0.0744,1.0,1.1023,0.75,0.0
3
+ direct_video,Qwen3-VL-8B-Instruct,704,0.2514,0.1443,1.0,0.9702,0.8026,0.0
4
+ privte_text,Qwen3.6-Flash,704,0.3935,0.2094,0.9616,0.7208,0.8833,0.0
MDU-RiskBench/reference_results/direct_video_comparison.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "input": "direct_video",
4
+ "model": "Keye-VL-1.5-8B",
5
+ "participants": 704,
6
+ "accuracy": 0.1747,
7
+ "macro_f1": 0.0744,
8
+ "coverage": 1.0,
9
+ "selective_ordinal_mae": 1.1023,
10
+ "selective_within_one": 0.75,
11
+ "elevated_recall": 0.0
12
+ },
13
+ {
14
+ "input": "direct_video",
15
+ "model": "Qwen3-VL-8B-Instruct",
16
+ "participants": 704,
17
+ "accuracy": 0.2514,
18
+ "macro_f1": 0.1443,
19
+ "coverage": 1.0,
20
+ "selective_ordinal_mae": 0.9702,
21
+ "selective_within_one": 0.8026,
22
+ "elevated_recall": 0.0
23
+ },
24
+ {
25
+ "input": "privte_text",
26
+ "model": "Qwen3.6-Flash",
27
+ "participants": 704,
28
+ "accuracy": 0.3935,
29
+ "macro_f1": 0.2094,
30
+ "coverage": 0.9616,
31
+ "selective_ordinal_mae": 0.7208,
32
+ "selective_within_one": 0.8833,
33
+ "elevated_recall": 0.0
34
+ }
35
+ ]
MDU-RiskBench/reference_results/llm_full_matrix.csv ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ setting,model,participants,accuracy,macro_f1,ordinal_mae,qwk,within_one,severe_error,elevated_recall,abstention,coverage
2
+ video_only,qwen3.6-flash,850,0.3941,0.2204,0.7015,0.0498,0.8943,0.1057,0.0,0.0541,0.9459
3
+ video_only,deepseek-v4-flash,850,0.1906,0.1231,0.9924,-0.01,0.782,0.218,0.0,0.2282,0.7718
4
+ video_only,gpt-5.6-terra,850,0.1918,0.088,1.0433,0.0084,0.7638,0.2362,0.0,0.1035,0.8965
5
+ video_only,gemini-3.5-flash,850,0.1412,0.0702,1.0981,-0.0013,0.7504,0.2496,0.0,0.2082,0.7918
6
+ non_video_only,qwen3.6-flash,850,0.4612,0.3204,0.6191,0.3109,0.9186,0.0814,0.7969,0.0024,0.9976
7
+ non_video_only,deepseek-v4-flash,850,0.5141,0.3161,0.5131,0.2821,0.9667,0.0333,0.2135,0.0118,0.9882
8
+ non_video_only,gpt-5.6-terra,850,0.5047,0.3641,0.5541,0.4098,0.9412,0.0588,0.849,0.0,1.0
9
+ non_video_only,gemini-3.5-flash,850,0.4718,0.3413,0.5833,0.3724,0.9393,0.0607,0.776,0.0118,0.9882
10
+ all_privacy_filtered_text,qwen3.6-flash,850,0.5024,0.3124,0.54,0.2511,0.9576,0.0424,0.2708,0.0,1.0
11
+ all_privacy_filtered_text,deepseek-v4-flash,850,0.5106,0.2772,0.506,0.2669,0.9736,0.0264,0.0314,0.0188,0.9812
12
+ all_privacy_filtered_text,gpt-5.6-terra,850,0.5282,0.3923,0.5212,0.4559,0.9506,0.0494,0.7865,0.0,1.0
13
+ all_privacy_filtered_text,gemini-3.5-flash,850,0.5106,0.3748,0.529,0.4346,0.9574,0.0426,0.6979,0.0059,0.9941
MDU-RiskBench/reference_results/llm_full_matrix.json ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "setting": "video_only",
4
+ "model": "qwen3.6-flash",
5
+ "participants": 850,
6
+ "accuracy": 0.3941,
7
+ "macro_f1": 0.2204,
8
+ "ordinal_mae": 0.7015,
9
+ "qwk": 0.0498,
10
+ "within_one": 0.8943,
11
+ "severe_error": 0.1057,
12
+ "elevated_recall": 0.0,
13
+ "abstention": 0.0541,
14
+ "coverage": 0.9459
15
+ },
16
+ {
17
+ "setting": "video_only",
18
+ "model": "deepseek-v4-flash",
19
+ "participants": 850,
20
+ "accuracy": 0.1906,
21
+ "macro_f1": 0.1231,
22
+ "ordinal_mae": 0.9924,
23
+ "qwk": -0.01,
24
+ "within_one": 0.782,
25
+ "severe_error": 0.218,
26
+ "elevated_recall": 0.0,
27
+ "abstention": 0.2282,
28
+ "coverage": 0.7718
29
+ },
30
+ {
31
+ "setting": "video_only",
32
+ "model": "gpt-5.6-terra",
33
+ "participants": 850,
34
+ "accuracy": 0.1918,
35
+ "macro_f1": 0.088,
36
+ "ordinal_mae": 1.0433,
37
+ "qwk": 0.0084,
38
+ "within_one": 0.7638,
39
+ "severe_error": 0.2362,
40
+ "elevated_recall": 0.0,
41
+ "abstention": 0.1035,
42
+ "coverage": 0.8965
43
+ },
44
+ {
45
+ "setting": "video_only",
46
+ "model": "gemini-3.5-flash",
47
+ "participants": 850,
48
+ "accuracy": 0.1412,
49
+ "macro_f1": 0.0702,
50
+ "ordinal_mae": 1.0981,
51
+ "qwk": -0.0013,
52
+ "within_one": 0.7504,
53
+ "severe_error": 0.2496,
54
+ "elevated_recall": 0.0,
55
+ "abstention": 0.2082,
56
+ "coverage": 0.7918
57
+ },
58
+ {
59
+ "setting": "non_video_only",
60
+ "model": "qwen3.6-flash",
61
+ "participants": 850,
62
+ "accuracy": 0.4612,
63
+ "macro_f1": 0.3204,
64
+ "ordinal_mae": 0.6191,
65
+ "qwk": 0.3109,
66
+ "within_one": 0.9186,
67
+ "severe_error": 0.0814,
68
+ "elevated_recall": 0.7969,
69
+ "abstention": 0.0024,
70
+ "coverage": 0.9976
71
+ },
72
+ {
73
+ "setting": "non_video_only",
74
+ "model": "deepseek-v4-flash",
75
+ "participants": 850,
76
+ "accuracy": 0.5141,
77
+ "macro_f1": 0.3161,
78
+ "ordinal_mae": 0.5131,
79
+ "qwk": 0.2821,
80
+ "within_one": 0.9667,
81
+ "severe_error": 0.0333,
82
+ "elevated_recall": 0.2135,
83
+ "abstention": 0.0118,
84
+ "coverage": 0.9882
85
+ },
86
+ {
87
+ "setting": "non_video_only",
88
+ "model": "gpt-5.6-terra",
89
+ "participants": 850,
90
+ "accuracy": 0.5047,
91
+ "macro_f1": 0.3641,
92
+ "ordinal_mae": 0.5541,
93
+ "qwk": 0.4098,
94
+ "within_one": 0.9412,
95
+ "severe_error": 0.0588,
96
+ "elevated_recall": 0.849,
97
+ "abstention": 0.0,
98
+ "coverage": 1.0
99
+ },
100
+ {
101
+ "setting": "non_video_only",
102
+ "model": "gemini-3.5-flash",
103
+ "participants": 850,
104
+ "accuracy": 0.4718,
105
+ "macro_f1": 0.3413,
106
+ "ordinal_mae": 0.5833,
107
+ "qwk": 0.3724,
108
+ "within_one": 0.9393,
109
+ "severe_error": 0.0607,
110
+ "elevated_recall": 0.776,
111
+ "abstention": 0.0118,
112
+ "coverage": 0.9882
113
+ },
114
+ {
115
+ "setting": "all_privacy_filtered_text",
116
+ "model": "qwen3.6-flash",
117
+ "participants": 850,
118
+ "accuracy": 0.5024,
119
+ "macro_f1": 0.3124,
120
+ "ordinal_mae": 0.54,
121
+ "qwk": 0.2511,
122
+ "within_one": 0.9576,
123
+ "severe_error": 0.0424,
124
+ "elevated_recall": 0.2708,
125
+ "abstention": 0.0,
126
+ "coverage": 1.0
127
+ },
128
+ {
129
+ "setting": "all_privacy_filtered_text",
130
+ "model": "deepseek-v4-flash",
131
+ "participants": 850,
132
+ "accuracy": 0.5106,
133
+ "macro_f1": 0.2772,
134
+ "ordinal_mae": 0.506,
135
+ "qwk": 0.2669,
136
+ "within_one": 0.9736,
137
+ "severe_error": 0.0264,
138
+ "elevated_recall": 0.0314,
139
+ "abstention": 0.0188,
140
+ "coverage": 0.9812
141
+ },
142
+ {
143
+ "setting": "all_privacy_filtered_text",
144
+ "model": "gpt-5.6-terra",
145
+ "participants": 850,
146
+ "accuracy": 0.5282,
147
+ "macro_f1": 0.3923,
148
+ "ordinal_mae": 0.5212,
149
+ "qwk": 0.4559,
150
+ "within_one": 0.9506,
151
+ "severe_error": 0.0494,
152
+ "elevated_recall": 0.7865,
153
+ "abstention": 0.0,
154
+ "coverage": 1.0
155
+ },
156
+ {
157
+ "setting": "all_privacy_filtered_text",
158
+ "model": "gemini-3.5-flash",
159
+ "participants": 850,
160
+ "accuracy": 0.5106,
161
+ "macro_f1": 0.3748,
162
+ "ordinal_mae": 0.529,
163
+ "qwk": 0.4346,
164
+ "within_one": 0.9574,
165
+ "severe_error": 0.0426,
166
+ "elevated_recall": 0.6979,
167
+ "abstention": 0.0059,
168
+ "coverage": 0.9941
169
+ }
170
+ ]
MDU-RiskBench/reference_results/llm_setting_means.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ setting,models,participants_per_model,accuracy,macro_f1,ordinal_mae,qwk,within_one,severe_error,elevated_recall,abstention,coverage
2
+ video_only,4,850,0.2294,0.1254,0.9588,0.0117,0.7976,0.2024,0.0,0.1485,0.8515
3
+ non_video_only,4,850,0.4879,0.3355,0.5674,0.3438,0.9415,0.0585,0.6589,0.0065,0.9935
4
+ all_privacy_filtered_text,4,850,0.513,0.3392,0.5241,0.3521,0.9598,0.0402,0.4466,0.0062,0.9938
MDU-RiskBench/reference_results/llm_setting_means.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "setting": "video_only",
4
+ "models": 4,
5
+ "participants_per_model": 850,
6
+ "accuracy": 0.2294,
7
+ "macro_f1": 0.1254,
8
+ "ordinal_mae": 0.9588,
9
+ "qwk": 0.0117,
10
+ "within_one": 0.7976,
11
+ "severe_error": 0.2024,
12
+ "elevated_recall": 0.0,
13
+ "abstention": 0.1485,
14
+ "coverage": 0.8515
15
+ },
16
+ {
17
+ "setting": "non_video_only",
18
+ "models": 4,
19
+ "participants_per_model": 850,
20
+ "accuracy": 0.4879,
21
+ "macro_f1": 0.3355,
22
+ "ordinal_mae": 0.5674,
23
+ "qwk": 0.3438,
24
+ "within_one": 0.9415,
25
+ "severe_error": 0.0585,
26
+ "elevated_recall": 0.6589,
27
+ "abstention": 0.0065,
28
+ "coverage": 0.9935
29
+ },
30
+ {
31
+ "setting": "all_privacy_filtered_text",
32
+ "models": 4,
33
+ "participants_per_model": 850,
34
+ "accuracy": 0.513,
35
+ "macro_f1": 0.3392,
36
+ "ordinal_mae": 0.5241,
37
+ "qwk": 0.3521,
38
+ "within_one": 0.9598,
39
+ "severe_error": 0.0402,
40
+ "elevated_recall": 0.4466,
41
+ "abstention": 0.0062,
42
+ "coverage": 0.9938
43
+ }
44
+ ]
MDU-RiskBench/reference_results/trained_video_only_baselines.csv ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ method,test_participants,accuracy,macro_f1,ordinal_mae,qwk,within_one,elevated_recall
2
+ Majority,126,0.4921,0.1649,0.5317,0.0,0.9762,0.0
3
+ TF-IDF,126,0.619,0.3307,0.4206,0.284,0.9683,0.0
4
+ Logistic,126,0.4683,0.4,0.746,0.3384,0.8095,0.6296
5
+ Boosted stumps,126,0.6349,0.3477,0.4206,0.2876,0.9603,0.0
6
+ Positional-W,126,0.5079,0.3826,0.6349,0.3001,0.873,0.4074
MDU-RiskBench/reference_results/trained_video_only_baselines.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "method": "Majority",
4
+ "test_participants": 126,
5
+ "accuracy": 0.4921,
6
+ "macro_f1": 0.1649,
7
+ "ordinal_mae": 0.5317,
8
+ "qwk": 0.0,
9
+ "within_one": 0.9762,
10
+ "elevated_recall": 0.0
11
+ },
12
+ {
13
+ "method": "TF-IDF",
14
+ "test_participants": 126,
15
+ "accuracy": 0.619,
16
+ "macro_f1": 0.3307,
17
+ "ordinal_mae": 0.4206,
18
+ "qwk": 0.284,
19
+ "within_one": 0.9683,
20
+ "elevated_recall": 0.0
21
+ },
22
+ {
23
+ "method": "Logistic",
24
+ "test_participants": 126,
25
+ "accuracy": 0.4683,
26
+ "macro_f1": 0.4,
27
+ "ordinal_mae": 0.746,
28
+ "qwk": 0.3384,
29
+ "within_one": 0.8095,
30
+ "elevated_recall": 0.6296
31
+ },
32
+ {
33
+ "method": "Boosted stumps",
34
+ "test_participants": 126,
35
+ "accuracy": 0.6349,
36
+ "macro_f1": 0.3477,
37
+ "ordinal_mae": 0.4206,
38
+ "qwk": 0.2876,
39
+ "within_one": 0.9603,
40
+ "elevated_recall": 0.0
41
+ },
42
+ {
43
+ "method": "Positional-W",
44
+ "test_participants": 126,
45
+ "accuracy": 0.5079,
46
+ "macro_f1": 0.3826,
47
+ "ordinal_mae": 0.6349,
48
+ "qwk": 0.3001,
49
+ "within_one": 0.873,
50
+ "elevated_recall": 0.4074
51
+ }
52
+ ]
MDU-RiskText/README.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MDU-RiskText
2
+
3
+ MDU-RiskText contains all 850 participant-level textual evidence records for
4
+ the three headline evidence settings. Each setting is split into train,
5
+ validation, and test gzip-compressed JSONL files.
6
+
7
+ Every row has the following fields:
8
+
9
+ - `schema_version`: public participant-record schema version;
10
+ - `sample_id`: stable public participant ID shared across settings;
11
+ - `split`: `train`, `validation`, or `test`;
12
+ - `target_label`: ordinal risk label and aggregated window-label counts;
13
+ - `benchmark_setting`: evidence configuration name;
14
+ - `llm_evidence_package`: structured model-facing JSON object;
15
+ - `text_evidence`: compact serialization of that same package.
16
+
17
+ The public files preserve the complete model-facing inputs. They intentionally
18
+ exclude redundant internal feature blocks, source paths, source filenames,
19
+ internal participant IDs, and preprocessing debug views that were not supplied
20
+ to benchmark models.
MDU-RiskText/all_filtered_text/test.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50840c1ddc3fc76ebe21814cf2b41865644830ea21fa20e1a293e15c173439e4
3
+ size 452994
MDU-RiskText/all_filtered_text/train.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6046f11a57db90a140ecb9e1f1d81c9182277d97f3ae9c9b139c080df5f8a1ca
3
+ size 2099999
MDU-RiskText/all_filtered_text/validation.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ed49e171f093761671416ff060da0f1242a56eb38c2e42773170d2810ec44e4
3
+ size 480862
MDU-RiskText/non_video_only/test.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4044b80e11222672f8f0c31c1f74e6e86fd1f97a758f869e2e92257c3eec4fd3
3
+ size 32918
MDU-RiskText/non_video_only/train.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a95077c2d8e95a1cb5e20a5b5c9c954853a942bbff01cdc5a815ad25201164a
3
+ size 139533
MDU-RiskText/non_video_only/validation.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8bbdeecd60c97e9a800f5a4c8c027c63966208e512165ec28daed7557991fcb
3
+ size 34139
MDU-RiskText/record.schema.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "MDU-RiskText participant record",
4
+ "type": "object",
5
+ "required": [
6
+ "schema_version",
7
+ "sample_id",
8
+ "split",
9
+ "target_label",
10
+ "benchmark_setting",
11
+ "llm_evidence_package",
12
+ "text_evidence"
13
+ ],
14
+ "properties": {
15
+ "schema_version": {
16
+ "const": "mdu_risktext.participant_record.v1"
17
+ },
18
+ "sample_id": {
19
+ "type": "string",
20
+ "pattern": "^MDURT_[0-9]{6}$"
21
+ },
22
+ "split": {
23
+ "enum": [
24
+ "train",
25
+ "validation",
26
+ "test"
27
+ ]
28
+ },
29
+ "benchmark_setting": {
30
+ "enum": [
31
+ "video_only",
32
+ "non_video_only",
33
+ "all_filtered_text"
34
+ ]
35
+ },
36
+ "target_label": {
37
+ "type": "object",
38
+ "required": [
39
+ "risk_level",
40
+ "available"
41
+ ],
42
+ "properties": {
43
+ "risk_level": {
44
+ "enum": [
45
+ "no_observed_risk",
46
+ "mild_risk",
47
+ "moderate_risk",
48
+ "high_risk"
49
+ ]
50
+ }
51
+ }
52
+ },
53
+ "llm_evidence_package": {
54
+ "type": "object"
55
+ },
56
+ "text_evidence": {
57
+ "type": "string"
58
+ }
59
+ }
60
+ }
MDU-RiskText/video_only/test.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09d1de11c631057e2c675ffc905070659aa7476659129406fa553edac6982013
3
+ size 260025
MDU-RiskText/video_only/train.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3dce8f876a5d1b190ee2963b6dcf7f754091c73b18c51ed24f3addf1b2c7ebd3
3
+ size 1175832
MDU-RiskText/video_only/validation.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9be520041a74fa35669171e4ae863f2cac83a218c458164b2d096706cd383fb
3
+ size 274850
README.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: MDU-RiskText and MDU-RiskBench
3
+ language:
4
+ - en
5
+ - zh
6
+ license: other
7
+ task_categories:
8
+ - text-classification
9
+ tags:
10
+ - privacy
11
+ - video-to-text
12
+ - ordinal-classification
13
+ - youth-digital-use
14
+ - evidence-grounding
15
+ configs:
16
+ - config_name: video_only
17
+ data_files:
18
+ - split: train
19
+ path: MDU-RiskText/video_only/train.jsonl.gz
20
+ - split: validation
21
+ path: MDU-RiskText/video_only/validation.jsonl.gz
22
+ - split: test
23
+ path: MDU-RiskText/video_only/test.jsonl.gz
24
+ - config_name: non_video_only
25
+ data_files:
26
+ - split: train
27
+ path: MDU-RiskText/non_video_only/train.jsonl.gz
28
+ - split: validation
29
+ path: MDU-RiskText/non_video_only/validation.jsonl.gz
30
+ - split: test
31
+ path: MDU-RiskText/non_video_only/test.jsonl.gz
32
+ - config_name: all_filtered_text
33
+ data_files:
34
+ - split: train
35
+ path: MDU-RiskText/all_filtered_text/train.jsonl.gz
36
+ - split: validation
37
+ path: MDU-RiskText/all_filtered_text/validation.jsonl.gz
38
+ - split: test
39
+ path: MDU-RiskText/all_filtered_text/test.jsonl.gz
40
+ ---
41
+
42
+ # MDU-RiskText and MDU-RiskBench
43
+
44
+ This repository contains the public 850-participant release associated with
45
+ PriVTE: Privacy-Preserving Video-to-Text Evidence Encoding for Youth Digital
46
+ Use Risk Screening.
47
+
48
+ ## Data products
49
+
50
+ - **MDU-RiskText** contains participant-level, privacy-filtered textual
51
+ evidence, the frozen ordinal target, and participant-disjoint split for all
52
+ 850 participants.
53
+ - **MDU-RiskBench** defines the task, label order, three headline evidence
54
+ settings, participant index, evaluation protocol, and reference metric code.
55
+
56
+ The frozen cohort contains 9,831 selected source videos. It is split into 593
57
+ train, 131 validation, and 126 test participants. Target counts are 226
58
+ `no_observed_risk`, 432 `mild_risk`, 172 `moderate_risk`, and 20 `high_risk`.
59
+
60
+ ## Load with Hugging Face Datasets
61
+
62
+ ```python
63
+ from datasets import load_dataset
64
+
65
+ video = load_dataset("Herrieson/MDU-RiskText", "video_only")
66
+ non_video = load_dataset("Herrieson/MDU-RiskText", "non_video_only")
67
+ combined = load_dataset("Herrieson/MDU-RiskText", "all_filtered_text")
68
+ ```
69
+
70
+ Replace `Herrieson/MDU-RiskText` if the final dataset repository uses a
71
+ different owner or name. Each row includes `sample_id`, `split`,
72
+ `target_label`, `benchmark_setting`, `llm_evidence_package`, and
73
+ `text_evidence`. The last field is the compact JSON string supplied to the
74
+ text-only model runners.
75
+
76
+ ## Headline settings
77
+
78
+ | Configuration | Model-facing evidence |
79
+ |---|---|
80
+ | `video_only` | PriVTE evidence derived from locally processed video |
81
+ | `non_video_only` | Coarsened app-category, heart-rate-bin, and questionnaire-risk text |
82
+ | `all_filtered_text` | PriVTE video evidence plus the coarsened auxiliary text |
83
+
84
+ ## Labels and evaluation
85
+
86
+ The four risk labels are ordinal in the order listed above.
87
+ `insufficient_evidence` is reserved for model abstention and is not a fifth
88
+ severity. The benchmark reports exact accuracy and macro-F1, together with
89
+ ordinal MAE and RMSE on non-abstained predictions and prediction coverage.
90
+
91
+ ## Data construction
92
+
93
+ The source cohort was collected in school-based field studies involving young
94
+ participants in primary, middle, and high school settings in Beijing,
95
+ Zhejiang, Inner Mongolia, and other regions. Participants completed an
96
+ approximately 45-minute tablet-use session. PriVTE processes source video
97
+ locally and emits ordered observable-behavior evidence with quality gates,
98
+ relative stages, and evidence references. Auxiliary inputs are released only
99
+ as coarse categories or risk-signal bins.
100
+
101
+ Each participant contributes at most 12 videos selected uniformly over source
102
+ order. Every selected file was required to be nonempty, parseable, contain a
103
+ video stream of known duration, and provide at least four seconds of video.
104
+ The selection protocol does not replace a failed selected file with a nearby
105
+ file.
106
+
107
+ ## Public record design
108
+
109
+ Public sample IDs (`MDURT_######`) are consistent across all three settings.
110
+ The release records contain the complete model-facing evidence used by
111
+ MDU-RiskBench, but omit redundant internal preprocessing/debug copies and
112
+ operational provenance fields. `MANIFEST.json` reports row counts, byte sizes,
113
+ and SHA-256 hashes for every release artifact.
114
+
115
+ ## Intended use
116
+
117
+ The resource supports research on privacy-preserving behavioral evidence,
118
+ text-only ordinal screening, evidence grounding, selective prediction, and
119
+ comparison with direct-video systems. The targets are field-derived screening
120
+ judgments rather than clinical diagnoses. Model outputs are intended for
121
+ research analysis and human review rather than automated punitive decisions.
122
+
123
+ ## License and citation
124
+
125
+ See `LICENSE_DATA.md` for the dataset terms and `CITATION.cff` for citation
126
+ metadata. Software scripts are released under the accompanying code license;
127
+ the data terms apply to MDU-RiskText and MDU-RiskBench records.
scripts/build_release.py ADDED
@@ -0,0 +1,839 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build the public MDU-RiskText and MDU-RiskBench Hugging Face bundle.
3
+
4
+ The internal experiment JSONL files contain several redundant pipeline views.
5
+ This builder publishes the complete model-facing evidence packages used by the
6
+ benchmark, frozen labels and splits, while replacing internal participant IDs
7
+ with stable public IDs.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import argparse
13
+ import gzip
14
+ import hashlib
15
+ import io
16
+ import json
17
+ import re
18
+ import shutil
19
+ from collections import Counter
20
+ from pathlib import Path
21
+ from typing import Any, Iterable
22
+
23
+
24
+ SETTINGS = ("video_only", "non_video_only", "all_filtered_text")
25
+ SPLITS = ("train", "validation", "test")
26
+ RISK_LEVELS = (
27
+ "no_observed_risk",
28
+ "mild_risk",
29
+ "moderate_risk",
30
+ "high_risk",
31
+ )
32
+ SETTING_ALIASES = {"all_privacy_filtered_text": "all_filtered_text"}
33
+ BLOCKED_TEXT_PATTERNS = {
34
+ "developer_home": re.compile(r"/home/[A-Za-z0-9._-]+/"),
35
+ "mounted_drive": re.compile(r"/mnt/[A-Za-z]/"),
36
+ "windows_user": re.compile(r"[A-Za-z]:\\\\Users\\\\[^\\\\]+\\\\"),
37
+ "internal_evidence_id": re.compile(r"evidence_internal_[A-Za-z0-9_-]+"),
38
+ "internal_person_id": re.compile(r"\binternal_[A-Za-z0-9_-]+\b"),
39
+ "source_subset": re.compile(r"strict850|schemafix", re.I),
40
+ "spreadsheet": re.compile(r"\.xlsx?\b", re.I),
41
+ }
42
+
43
+
44
+ def compact_json(value: Any) -> str:
45
+ return json.dumps(value, ensure_ascii=False, sort_keys=True, separators=(",", ":"))
46
+
47
+
48
+ def sha256(path: Path) -> str:
49
+ digest = hashlib.sha256()
50
+ with path.open("rb") as handle:
51
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
52
+ digest.update(chunk)
53
+ return digest.hexdigest()
54
+
55
+
56
+ def write_json(path: Path, value: Any) -> None:
57
+ path.parent.mkdir(parents=True, exist_ok=True)
58
+ path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
59
+
60
+
61
+ def write_text(path: Path, value: str) -> None:
62
+ path.parent.mkdir(parents=True, exist_ok=True)
63
+ path.write_text(value.rstrip() + "\n", encoding="utf-8")
64
+
65
+
66
+ class DeterministicGzipJsonlWriter:
67
+ def __init__(self, path: Path) -> None:
68
+ path.parent.mkdir(parents=True, exist_ok=True)
69
+ self.raw = path.open("wb")
70
+ self.gz = gzip.GzipFile(filename="", mode="wb", fileobj=self.raw, mtime=0)
71
+ self.text = io.TextIOWrapper(self.gz, encoding="utf-8", newline="\n")
72
+
73
+ def write(self, value: Any) -> None:
74
+ self.text.write(compact_json(value) + "\n")
75
+
76
+ def close(self) -> None:
77
+ self.text.flush()
78
+ self.text.detach()
79
+ self.gz.close()
80
+ self.raw.close()
81
+
82
+ def __enter__(self) -> "DeterministicGzipJsonlWriter":
83
+ return self
84
+
85
+ def __exit__(self, *_: Any) -> None:
86
+ self.close()
87
+
88
+
89
+ def iter_jsonl(path: Path) -> Iterable[dict[str, Any]]:
90
+ with path.open(encoding="utf-8") as handle:
91
+ for line_number, line in enumerate(handle, 1):
92
+ if not line.strip():
93
+ continue
94
+ value = json.loads(line)
95
+ if not isinstance(value, dict):
96
+ raise ValueError(f"{path}:{line_number}: expected a JSON object")
97
+ yield value
98
+
99
+
100
+ def transform_strings(value: Any, old_id: str, public_id: str) -> Any:
101
+ if isinstance(value, dict):
102
+ return {
103
+ key: transform_strings(item, old_id, public_id)
104
+ for key, item in value.items()
105
+ if key not in {"internal_debug"}
106
+ }
107
+ if isinstance(value, list):
108
+ return [transform_strings(item, old_id, public_id) for item in value]
109
+ if isinstance(value, str):
110
+ value = value.replace(old_id, public_id)
111
+ return SETTING_ALIASES.get(value, value)
112
+ return value
113
+
114
+
115
+ def public_target_label(source: dict[str, Any]) -> dict[str, Any]:
116
+ risk_level = source.get("risk_level")
117
+ if risk_level not in RISK_LEVELS:
118
+ raise ValueError(f"unexpected target label: {risk_level!r}")
119
+ counts = source.get("risk_label_counts", {})
120
+ if not isinstance(counts, dict):
121
+ counts = {}
122
+ return {
123
+ "risk_level": risk_level,
124
+ "available": True,
125
+ "aggregation_method": "majority_vote_over_non_insufficient_windows",
126
+ "window_label_counts": {
127
+ str(key): int(value)
128
+ for key, value in sorted(counts.items())
129
+ if isinstance(value, (int, float))
130
+ },
131
+ }
132
+
133
+
134
+ def build_record(
135
+ source: dict[str, Any], setting: str, public_id: str
136
+ ) -> dict[str, Any]:
137
+ old_id = source.get("sample_id")
138
+ if not isinstance(old_id, str):
139
+ raise ValueError("record lacks sample_id")
140
+ split = source.get("split")
141
+ if split not in SPLITS:
142
+ raise ValueError(f"unexpected split: {split!r}")
143
+ package_text = source.get("text_evidence")
144
+ if not isinstance(package_text, str):
145
+ raise ValueError(f"{old_id}: text_evidence is not a string")
146
+ package = json.loads(package_text)
147
+ package = transform_strings(package, old_id, public_id)
148
+ package["sample_id"] = public_id
149
+ package["benchmark_setting"] = setting
150
+ return {
151
+ "schema_version": "mdu_risktext.participant_record.v1",
152
+ "sample_id": public_id,
153
+ "split": split,
154
+ "target_label": public_target_label(source.get("target_label", {})),
155
+ "benchmark_setting": setting,
156
+ "llm_evidence_package": package,
157
+ "text_evidence": compact_json(package),
158
+ }
159
+
160
+
161
+ def collect_sources(paths: dict[str, Path]) -> dict[str, dict[str, dict[str, Any]]]:
162
+ records: dict[str, dict[str, dict[str, Any]]] = {}
163
+ for setting, path in paths.items():
164
+ setting_rows: dict[str, dict[str, Any]] = {}
165
+ for row in iter_jsonl(path):
166
+ sample_id = row.get("sample_id")
167
+ if not isinstance(sample_id, str):
168
+ raise ValueError(f"{path}: record lacks a string sample_id")
169
+ if sample_id in setting_rows:
170
+ raise ValueError(f"{path}: duplicate sample_id {sample_id}")
171
+ setting_rows[sample_id] = row
172
+ records[setting] = setting_rows
173
+ base_ids = set(records["video_only"])
174
+ if len(base_ids) != 850:
175
+ raise ValueError(f"expected 850 participants, found {len(base_ids)}")
176
+ for setting in SETTINGS:
177
+ if set(records[setting]) != base_ids:
178
+ raise ValueError(f"participant mismatch for {setting}")
179
+ for sample_id in base_ids:
180
+ base = records["video_only"][sample_id]
181
+ other = records[setting][sample_id]
182
+ if base.get("split") != other.get("split"):
183
+ raise ValueError(f"split mismatch for {sample_id} in {setting}")
184
+ if base.get("target_label", {}).get("risk_level") != other.get(
185
+ "target_label", {}
186
+ ).get("risk_level"):
187
+ raise ValueError(f"label mismatch for {sample_id} in {setting}")
188
+ return records
189
+
190
+
191
+ def make_public_id_map(internal_ids: Iterable[str]) -> dict[str, str]:
192
+ return {
193
+ internal_id: f"MDURT_{index:06d}"
194
+ for index, internal_id in enumerate(sorted(internal_ids), 1)
195
+ }
196
+
197
+
198
+ def dataset_card() -> str:
199
+ return """---
200
+ pretty_name: MDU-RiskText and MDU-RiskBench
201
+ language:
202
+ - en
203
+ - zh
204
+ license: other
205
+ task_categories:
206
+ - text-classification
207
+ tags:
208
+ - privacy
209
+ - video-to-text
210
+ - ordinal-classification
211
+ - youth-digital-use
212
+ - evidence-grounding
213
+ configs:
214
+ - config_name: video_only
215
+ data_files:
216
+ - split: train
217
+ path: MDU-RiskText/video_only/train.jsonl.gz
218
+ - split: validation
219
+ path: MDU-RiskText/video_only/validation.jsonl.gz
220
+ - split: test
221
+ path: MDU-RiskText/video_only/test.jsonl.gz
222
+ - config_name: non_video_only
223
+ data_files:
224
+ - split: train
225
+ path: MDU-RiskText/non_video_only/train.jsonl.gz
226
+ - split: validation
227
+ path: MDU-RiskText/non_video_only/validation.jsonl.gz
228
+ - split: test
229
+ path: MDU-RiskText/non_video_only/test.jsonl.gz
230
+ - config_name: all_filtered_text
231
+ data_files:
232
+ - split: train
233
+ path: MDU-RiskText/all_filtered_text/train.jsonl.gz
234
+ - split: validation
235
+ path: MDU-RiskText/all_filtered_text/validation.jsonl.gz
236
+ - split: test
237
+ path: MDU-RiskText/all_filtered_text/test.jsonl.gz
238
+ ---
239
+
240
+ # MDU-RiskText and MDU-RiskBench
241
+
242
+ This repository contains the public 850-participant release associated with
243
+ PriVTE: Privacy-Preserving Video-to-Text Evidence Encoding for Youth Digital
244
+ Use Risk Screening.
245
+
246
+ ## Data products
247
+
248
+ - **MDU-RiskText** contains participant-level, privacy-filtered textual
249
+ evidence, the frozen ordinal target, and participant-disjoint split for all
250
+ 850 participants.
251
+ - **MDU-RiskBench** defines the task, label order, three headline evidence
252
+ settings, participant index, evaluation protocol, and reference metric code.
253
+
254
+ The frozen cohort contains 9,831 selected source videos. It is split into 593
255
+ train, 131 validation, and 126 test participants. Target counts are 226
256
+ `no_observed_risk`, 432 `mild_risk`, 172 `moderate_risk`, and 20 `high_risk`.
257
+
258
+ ## Load with Hugging Face Datasets
259
+
260
+ ```python
261
+ from datasets import load_dataset
262
+
263
+ video = load_dataset("Herrieson/MDU-RiskText", "video_only")
264
+ non_video = load_dataset("Herrieson/MDU-RiskText", "non_video_only")
265
+ combined = load_dataset("Herrieson/MDU-RiskText", "all_filtered_text")
266
+ ```
267
+
268
+ Replace `Herrieson/MDU-RiskText` if the final dataset repository uses a
269
+ different owner or name. Each row includes `sample_id`, `split`,
270
+ `target_label`, `benchmark_setting`, `llm_evidence_package`, and
271
+ `text_evidence`. The last field is the compact JSON string supplied to the
272
+ text-only model runners.
273
+
274
+ ## Headline settings
275
+
276
+ | Configuration | Model-facing evidence |
277
+ |---|---|
278
+ | `video_only` | PriVTE evidence derived from locally processed video |
279
+ | `non_video_only` | Coarsened app-category, heart-rate-bin, and questionnaire-risk text |
280
+ | `all_filtered_text` | PriVTE video evidence plus the coarsened auxiliary text |
281
+
282
+ ## Labels and evaluation
283
+
284
+ The four risk labels are ordinal in the order listed above.
285
+ `insufficient_evidence` is reserved for model abstention and is not a fifth
286
+ severity. The benchmark reports exact accuracy and macro-F1, together with
287
+ ordinal MAE and RMSE on non-abstained predictions and prediction coverage.
288
+
289
+ ## Data construction
290
+
291
+ The source cohort was collected in school-based field studies involving young
292
+ participants in primary, middle, and high school settings in Beijing,
293
+ Zhejiang, Inner Mongolia, and other regions. Participants completed an
294
+ approximately 45-minute tablet-use session. PriVTE processes source video
295
+ locally and emits ordered observable-behavior evidence with quality gates,
296
+ relative stages, and evidence references. Auxiliary inputs are released only
297
+ as coarse categories or risk-signal bins.
298
+
299
+ Each participant contributes at most 12 videos selected uniformly over source
300
+ order. Every selected file was required to be nonempty, parseable, contain a
301
+ video stream of known duration, and provide at least four seconds of video.
302
+ The selection protocol does not replace a failed selected file with a nearby
303
+ file.
304
+
305
+ ## Public record design
306
+
307
+ Public sample IDs (`MDURT_######`) are consistent across all three settings.
308
+ The release records contain the complete model-facing evidence used by
309
+ MDU-RiskBench, but omit redundant internal preprocessing/debug copies and
310
+ operational provenance fields. `MANIFEST.json` reports row counts, byte sizes,
311
+ and SHA-256 hashes for every release artifact.
312
+
313
+ ## Intended use
314
+
315
+ The resource supports research on privacy-preserving behavioral evidence,
316
+ text-only ordinal screening, evidence grounding, selective prediction, and
317
+ comparison with direct-video systems. The targets are field-derived screening
318
+ judgments rather than clinical diagnoses. Model outputs are intended for
319
+ research analysis and human review rather than automated punitive decisions.
320
+
321
+ ## License and citation
322
+
323
+ See `LICENSE_DATA.md` for the dataset terms and `CITATION.cff` for citation
324
+ metadata. Software scripts are released under the accompanying code license;
325
+ the data terms apply to MDU-RiskText and MDU-RiskBench records.
326
+ """
327
+
328
+
329
+ def mdu_risktext_readme() -> str:
330
+ return """# MDU-RiskText
331
+
332
+ MDU-RiskText contains all 850 participant-level textual evidence records for
333
+ the three headline evidence settings. Each setting is split into train,
334
+ validation, and test gzip-compressed JSONL files.
335
+
336
+ Every row has the following fields:
337
+
338
+ - `schema_version`: public participant-record schema version;
339
+ - `sample_id`: stable public participant ID shared across settings;
340
+ - `split`: `train`, `validation`, or `test`;
341
+ - `target_label`: ordinal risk label and aggregated window-label counts;
342
+ - `benchmark_setting`: evidence configuration name;
343
+ - `llm_evidence_package`: structured model-facing JSON object;
344
+ - `text_evidence`: compact serialization of that same package.
345
+
346
+ The public files preserve the complete model-facing inputs. They intentionally
347
+ exclude redundant internal feature blocks, source paths, source filenames,
348
+ internal participant IDs, and preprocessing debug views that were not supplied
349
+ to benchmark models.
350
+ """
351
+
352
+
353
+ def benchmark_readme() -> str:
354
+ return """# MDU-RiskBench
355
+
356
+ MDU-RiskBench is the benchmark definition paired with MDU-RiskText. It
357
+ contains:
358
+
359
+ - `benchmark.json`: cohort, labels, settings, and metric definitions;
360
+ - `participants.jsonl.gz`: the frozen 850-participant index;
361
+ - `prediction.schema.json`: submission record contract;
362
+ - `reference_results/`: aggregate result tables when available;
363
+ - `../scripts/evaluate_predictions.py`: reference evaluator;
364
+ - `../scripts/verify_release.py`: integrity and alignment validator.
365
+
366
+ A prediction JSONL contains one object per participant:
367
+
368
+ ```json
369
+ {"sample_id":"MDURT_000001","risk_level":"mild_risk"}
370
+ ```
371
+
372
+ Models may additionally output `confidence`, evidence references, rationale,
373
+ and review flags; the reference evaluator uses `sample_id` and `risk_level`.
374
+ """
375
+
376
+
377
+ def data_license() -> str:
378
+ return """# MDU-RiskText / MDU-RiskBench Data Terms
379
+
380
+ Copyright (c) 2026 PriVTE contributors.
381
+
382
+ Permission is granted to use, reproduce, and redistribute the released
383
+ MDU-RiskText and MDU-RiskBench files for research, education, evaluation, and
384
+ non-commercial development, provided that users:
385
+
386
+ 1. cite the dataset and PriVTE paper;
387
+ 2. do not attempt to identify or contact participants or institutions;
388
+ 3. do not combine the records with external data for re-identification;
389
+ 4. do not use the data or derived systems for automated punishment,
390
+ disciplinary action, eligibility denial, or individual surveillance; and
391
+ 5. preserve these terms and the dataset attribution in redistributions.
392
+
393
+ The data are provided as-is, without warranty. These terms cover the dataset
394
+ records and benchmark metadata; separately released source code may use a
395
+ different software license.
396
+ """
397
+
398
+
399
+ def verify_script() -> str:
400
+ return r'''#!/usr/bin/env python3
401
+ """Verify MDU-RiskText/MDU-RiskBench row alignment and file hashes."""
402
+
403
+ from __future__ import annotations
404
+
405
+ import gzip
406
+ import hashlib
407
+ import json
408
+ from collections import Counter
409
+ from pathlib import Path
410
+
411
+ ROOT = Path(__file__).resolve().parents[1]
412
+ SETTINGS = ("video_only", "non_video_only", "all_filtered_text")
413
+ SPLITS = ("train", "validation", "test")
414
+
415
+
416
+ def digest(path: Path) -> str:
417
+ value = hashlib.sha256()
418
+ with path.open("rb") as handle:
419
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
420
+ value.update(chunk)
421
+ return value.hexdigest()
422
+
423
+
424
+ def rows(path: Path):
425
+ with gzip.open(path, "rt", encoding="utf-8") as handle:
426
+ for line in handle:
427
+ if line.strip():
428
+ yield json.loads(line)
429
+
430
+
431
+ def main() -> None:
432
+ manifest = json.loads((ROOT / "MANIFEST.json").read_text(encoding="utf-8"))
433
+ for entry in manifest["files"]:
434
+ path = ROOT / entry["path"]
435
+ if path.stat().st_size != entry["bytes"]:
436
+ raise SystemExit(f"size mismatch: {entry['path']}")
437
+ if digest(path) != entry["sha256"]:
438
+ raise SystemExit(f"hash mismatch: {entry['path']}")
439
+
440
+ identities = {}
441
+ for setting in SETTINGS:
442
+ current = {}
443
+ for split in SPLITS:
444
+ path = ROOT / "MDU-RiskText" / setting / f"{split}.jsonl.gz"
445
+ for row in rows(path):
446
+ if row["split"] != split or row["benchmark_setting"] != setting:
447
+ raise SystemExit(f"metadata mismatch: {path}")
448
+ package = row["llm_evidence_package"]
449
+ if package["sample_id"] != row["sample_id"]:
450
+ raise SystemExit(f"package ID mismatch: {row['sample_id']}")
451
+ if json.loads(row["text_evidence"]) != package:
452
+ raise SystemExit(f"text package mismatch: {row['sample_id']}")
453
+ current[row["sample_id"]] = (
454
+ split,
455
+ row["target_label"]["risk_level"],
456
+ )
457
+ if len(current) != 850:
458
+ raise SystemExit(f"{setting}: expected 850 records, got {len(current)}")
459
+ if identities and current != identities:
460
+ raise SystemExit(f"cross-setting identity mismatch: {setting}")
461
+ identities = current
462
+
463
+ split_counts = Counter(split for split, _ in identities.values())
464
+ label_counts = Counter(label for _, label in identities.values())
465
+ expected_splits = {"train": 593, "validation": 131, "test": 126}
466
+ expected_labels = {
467
+ "no_observed_risk": 226,
468
+ "mild_risk": 432,
469
+ "moderate_risk": 172,
470
+ "high_risk": 20,
471
+ }
472
+ if dict(split_counts) != expected_splits:
473
+ raise SystemExit(f"split counts differ: {dict(split_counts)}")
474
+ if dict(label_counts) != expected_labels:
475
+ raise SystemExit(f"label counts differ: {dict(label_counts)}")
476
+ print("Verified 850 aligned participants across 3 settings and 9 data files.")
477
+
478
+
479
+ if __name__ == "__main__":
480
+ main()
481
+ '''
482
+
483
+
484
+ def evaluator_script() -> str:
485
+ return r'''#!/usr/bin/env python3
486
+ """Evaluate MDU-RiskBench participant-level prediction JSONL."""
487
+
488
+ from __future__ import annotations
489
+
490
+ import argparse
491
+ import gzip
492
+ import json
493
+ import math
494
+ from collections import Counter
495
+ from pathlib import Path
496
+
497
+ ORDER = {
498
+ "no_observed_risk": 0,
499
+ "mild_risk": 1,
500
+ "moderate_risk": 2,
501
+ "high_risk": 3,
502
+ }
503
+ ABSTAIN = "insufficient_evidence"
504
+
505
+
506
+ def read_jsonl(path: Path):
507
+ opener = gzip.open if path.suffix == ".gz" else open
508
+ with opener(path, "rt", encoding="utf-8") as handle:
509
+ for line in handle:
510
+ if line.strip():
511
+ yield json.loads(line)
512
+
513
+
514
+ def main() -> None:
515
+ parser = argparse.ArgumentParser()
516
+ parser.add_argument("--gold", type=Path, required=True)
517
+ parser.add_argument("--predictions", type=Path, required=True)
518
+ parser.add_argument("--output", type=Path)
519
+ args = parser.parse_args()
520
+
521
+ gold = {
522
+ row["sample_id"]: row["target_label"]["risk_level"]
523
+ for row in read_jsonl(args.gold)
524
+ }
525
+ pred = {row["sample_id"]: row["risk_level"] for row in read_jsonl(args.predictions)}
526
+ unknown = sorted(set(pred) - set(gold))
527
+ if unknown:
528
+ raise SystemExit(f"unknown prediction IDs: {unknown[:5]}")
529
+
530
+ labels = list(ORDER)
531
+ total = len(gold)
532
+ covered = [(gold[sid], pred.get(sid)) for sid in gold if pred.get(sid) in ORDER]
533
+ abstained = total - len(covered)
534
+ exact = sum(actual == predicted for actual, predicted in covered)
535
+ distances = [abs(ORDER[actual] - ORDER[predicted]) for actual, predicted in covered]
536
+ squared = [value * value for value in distances]
537
+ f1_values = []
538
+ for label in labels:
539
+ tp = sum(actual == label and predicted == label for actual, predicted in covered)
540
+ fp = sum(actual != label and predicted == label for actual, predicted in covered)
541
+ fn = sum(actual == label and predicted != label for actual, predicted in covered)
542
+ precision = tp / (tp + fp) if tp + fp else 0.0
543
+ recall = tp / (tp + fn) if tp + fn else 0.0
544
+ f1_values.append(
545
+ 2 * precision * recall / (precision + recall) if precision + recall else 0.0
546
+ )
547
+
548
+ n = len(covered)
549
+ report = {
550
+ "gold_records": total,
551
+ "prediction_records": len(pred),
552
+ "covered_records": n,
553
+ "abstained_or_missing_records": abstained,
554
+ "coverage": n / total if total else 0.0,
555
+ "selective_accuracy": exact / n if n else None,
556
+ "selective_macro_f1": sum(f1_values) / len(f1_values) if n else None,
557
+ "ordinal_mae": sum(distances) / n if n else None,
558
+ "ordinal_rmse": math.sqrt(sum(squared) / n) if n else None,
559
+ "prediction_distribution": dict(sorted(Counter(pred.values()).items())),
560
+ }
561
+ rendered = json.dumps(report, indent=2) + "\n"
562
+ if args.output:
563
+ args.output.write_text(rendered, encoding="utf-8")
564
+ print(rendered, end="")
565
+
566
+
567
+ if __name__ == "__main__":
568
+ main()
569
+ '''
570
+
571
+
572
+ def prediction_schema() -> dict[str, Any]:
573
+ return {
574
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
575
+ "title": "MDU-RiskBench prediction record",
576
+ "type": "object",
577
+ "required": ["sample_id", "risk_level"],
578
+ "properties": {
579
+ "sample_id": {"type": "string", "pattern": "^MDURT_[0-9]{6}$"},
580
+ "risk_level": {
581
+ "enum": [*RISK_LEVELS, "insufficient_evidence"]
582
+ },
583
+ "confidence": {"enum": ["low", "medium", "high"]},
584
+ "evidence_used": {"type": "array", "items": {"type": "string"}},
585
+ "needs_human_review": {"type": "boolean"},
586
+ },
587
+ "additionalProperties": True,
588
+ }
589
+
590
+
591
+ def record_schema() -> dict[str, Any]:
592
+ return {
593
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
594
+ "title": "MDU-RiskText participant record",
595
+ "type": "object",
596
+ "required": [
597
+ "schema_version",
598
+ "sample_id",
599
+ "split",
600
+ "target_label",
601
+ "benchmark_setting",
602
+ "llm_evidence_package",
603
+ "text_evidence",
604
+ ],
605
+ "properties": {
606
+ "schema_version": {"const": "mdu_risktext.participant_record.v1"},
607
+ "sample_id": {"type": "string", "pattern": "^MDURT_[0-9]{6}$"},
608
+ "split": {"enum": list(SPLITS)},
609
+ "benchmark_setting": {"enum": list(SETTINGS)},
610
+ "target_label": {
611
+ "type": "object",
612
+ "required": ["risk_level", "available"],
613
+ "properties": {"risk_level": {"enum": list(RISK_LEVELS)}},
614
+ },
615
+ "llm_evidence_package": {"type": "object"},
616
+ "text_evidence": {"type": "string"},
617
+ },
618
+ }
619
+
620
+
621
+ def benchmark_definition() -> dict[str, Any]:
622
+ return {
623
+ "schema_version": "mdu_riskbench.v1",
624
+ "name": "MDU-RiskBench",
625
+ "paired_dataset": "MDU-RiskText v1",
626
+ "task": "Text-only Youth Digital Use Risk Screening",
627
+ "participant_count": 850,
628
+ "selected_source_video_count": 9831,
629
+ "participant_disjoint_splits": True,
630
+ "split_counts": {"train": 593, "validation": 131, "test": 126},
631
+ "ordinal_labels": list(RISK_LEVELS),
632
+ "abstention_label": "insufficient_evidence",
633
+ "label_counts": {
634
+ "no_observed_risk": 226,
635
+ "mild_risk": 432,
636
+ "moderate_risk": 172,
637
+ "high_risk": 20,
638
+ },
639
+ "headline_settings": {
640
+ "video_only": "PriVTE privacy-filtered video-to-text evidence",
641
+ "non_video_only": (
642
+ "coarse app-category, heart-rate-bin, and questionnaire-risk text"
643
+ ),
644
+ "all_filtered_text": "PriVTE evidence plus coarse auxiliary text",
645
+ },
646
+ "primary_metrics": [
647
+ "accuracy",
648
+ "macro_f1",
649
+ "ordinal_mae",
650
+ "ordinal_rmse",
651
+ "coverage",
652
+ ],
653
+ "ordinal_metric_policy": (
654
+ "MAE and RMSE are computed on predictions in the four ordinal labels; "
655
+ "insufficient_evidence is reported through coverage."
656
+ ),
657
+ "source_video_selection": {
658
+ "maximum_selected_per_participant": 12,
659
+ "selection": "uniform_over_ordered_source_inventory",
660
+ "minimum_video_stream_duration_seconds": 4.0,
661
+ "all_selected_files_must_pass_technical_validation": True,
662
+ "replacement_after_selected_file_failure": False,
663
+ },
664
+ }
665
+
666
+
667
+ def citation_cff() -> str:
668
+ return """cff-version: 1.2.0
669
+ message: "If you use MDU-RiskText or MDU-RiskBench, please cite this dataset and the PriVTE paper."
670
+ title: "MDU-RiskText and MDU-RiskBench"
671
+ type: dataset
672
+ authors:
673
+ - name: "PriVTE Authors"
674
+ version: "1.0.0"
675
+ date-released: "2026-07-28"
676
+ repository-code: "https://github.com/Herrieson/privte-public"
677
+ """
678
+
679
+
680
+ def write_base_files(output: Path) -> None:
681
+ write_text(output / "README.md", dataset_card())
682
+ write_text(output / "LICENSE_DATA.md", data_license())
683
+ write_text(output / "CITATION.cff", citation_cff())
684
+ write_text(output / "MDU-RiskText" / "README.md", mdu_risktext_readme())
685
+ write_text(output / "MDU-RiskBench" / "README.md", benchmark_readme())
686
+ write_json(output / "MDU-RiskText" / "record.schema.json", record_schema())
687
+ write_json(output / "MDU-RiskBench" / "benchmark.json", benchmark_definition())
688
+ write_json(
689
+ output / "MDU-RiskBench" / "prediction.schema.json", prediction_schema()
690
+ )
691
+ write_text(output / "scripts" / "verify_release.py", verify_script())
692
+ write_text(output / "scripts" / "evaluate_predictions.py", evaluator_script())
693
+ shutil.copy2(Path(__file__).resolve(), output / "scripts" / "build_release.py")
694
+
695
+
696
+ def copy_reference_results(source: Path | None, output: Path) -> None:
697
+ if source is None or not source.exists():
698
+ return
699
+ destination = output / "MDU-RiskBench" / "reference_results"
700
+ destination.mkdir(parents=True, exist_ok=True)
701
+ for name in (
702
+ "trained_video_only_baselines.csv",
703
+ "trained_video_only_baselines.json",
704
+ "llm_full_matrix.csv",
705
+ "llm_full_matrix.json",
706
+ "llm_setting_means.csv",
707
+ "llm_setting_means.json",
708
+ "direct_video_comparison.csv",
709
+ "direct_video_comparison.json",
710
+ ):
711
+ candidate = source / name
712
+ if candidate.exists():
713
+ shutil.copy2(candidate, destination / name)
714
+
715
+
716
+ def audit_text(value: Any, context: str) -> None:
717
+ rendered = compact_json(value)
718
+ for name, pattern in BLOCKED_TEXT_PATTERNS.items():
719
+ match = pattern.search(rendered)
720
+ if match:
721
+ raise ValueError(f"{context}: blocked {name}: {match.group(0)!r}")
722
+
723
+
724
+ def build(args: argparse.Namespace) -> None:
725
+ output = args.output.resolve()
726
+ if output.exists():
727
+ if not args.overwrite:
728
+ raise SystemExit(f"output exists; pass --overwrite: {output}")
729
+ shutil.rmtree(output)
730
+ output.mkdir(parents=True)
731
+
732
+ paths = {
733
+ "video_only": args.video_only.resolve(),
734
+ "non_video_only": args.non_video_only.resolve(),
735
+ "all_filtered_text": args.all_filtered_text.resolve(),
736
+ }
737
+ records = collect_sources(paths)
738
+ public_ids = make_public_id_map(records["video_only"])
739
+ writers = {
740
+ (setting, split): DeterministicGzipJsonlWriter(
741
+ output / "MDU-RiskText" / setting / f"{split}.jsonl.gz"
742
+ )
743
+ for setting in SETTINGS
744
+ for split in SPLITS
745
+ }
746
+ participant_writer = DeterministicGzipJsonlWriter(
747
+ output / "MDU-RiskBench" / "participants.jsonl.gz"
748
+ )
749
+ row_counts: Counter[tuple[str, str]] = Counter()
750
+ split_counts: Counter[str] = Counter()
751
+ label_counts: Counter[str] = Counter()
752
+ try:
753
+ for internal_id in sorted(public_ids):
754
+ public_id = public_ids[internal_id]
755
+ base = records["video_only"][internal_id]
756
+ split = base["split"]
757
+ target = public_target_label(base["target_label"])
758
+ participant_writer.write(
759
+ {
760
+ "sample_id": public_id,
761
+ "split": split,
762
+ "target_label": target,
763
+ }
764
+ )
765
+ split_counts[split] += 1
766
+ label_counts[target["risk_level"]] += 1
767
+ for setting in SETTINGS:
768
+ record = build_record(records[setting][internal_id], setting, public_id)
769
+ audit_text(record, f"{setting}/{public_id}")
770
+ writers[(setting, split)].write(record)
771
+ row_counts[(setting, split)] += 1
772
+ finally:
773
+ participant_writer.close()
774
+ for writer in writers.values():
775
+ writer.close()
776
+
777
+ expected_splits = {"train": 593, "validation": 131, "test": 126}
778
+ expected_labels = {
779
+ "no_observed_risk": 226,
780
+ "mild_risk": 432,
781
+ "moderate_risk": 172,
782
+ "high_risk": 20,
783
+ }
784
+ if dict(split_counts) != expected_splits:
785
+ raise ValueError(f"unexpected split counts: {dict(split_counts)}")
786
+ if dict(label_counts) != expected_labels:
787
+ raise ValueError(f"unexpected label counts: {dict(label_counts)}")
788
+
789
+ write_base_files(output)
790
+ copy_reference_results(args.reference_results, output)
791
+
792
+ files = []
793
+ for path in sorted(output.rglob("*")):
794
+ if not path.is_file() or path.name == "MANIFEST.json":
795
+ continue
796
+ relative = path.relative_to(output).as_posix()
797
+ entry: dict[str, Any] = {
798
+ "path": relative,
799
+ "bytes": path.stat().st_size,
800
+ "sha256": sha256(path),
801
+ }
802
+ if path.name.endswith(".jsonl.gz"):
803
+ if relative == "MDU-RiskBench/participants.jsonl.gz":
804
+ entry["rows"] = 850
805
+ else:
806
+ parts = path.relative_to(output / "MDU-RiskText").parts
807
+ setting = parts[0]
808
+ split = path.name.removesuffix(".jsonl.gz")
809
+ entry["rows"] = row_counts[(setting, split)]
810
+ files.append(entry)
811
+ manifest = {
812
+ "schema_version": "mdu_risk_huggingface_release_manifest.v1",
813
+ "release_version": "1.0.0",
814
+ "participant_count": 850,
815
+ "selected_source_video_count": 9831,
816
+ "settings": list(SETTINGS),
817
+ "split_counts": expected_splits,
818
+ "label_counts": expected_labels,
819
+ "files": files,
820
+ }
821
+ write_json(output / "MANIFEST.json", manifest)
822
+ print(f"Built Hugging Face release at {output}")
823
+ print(f"Participants: {sum(split_counts.values())}")
824
+ print(f"Compressed bundle bytes: {sum(p.stat().st_size for p in output.rglob('*') if p.is_file())}")
825
+
826
+
827
+ def parse_args() -> argparse.Namespace:
828
+ parser = argparse.ArgumentParser()
829
+ parser.add_argument("--video-only", type=Path, required=True)
830
+ parser.add_argument("--non-video-only", type=Path, required=True)
831
+ parser.add_argument("--all-filtered-text", type=Path, required=True)
832
+ parser.add_argument("--reference-results", type=Path)
833
+ parser.add_argument("--output", type=Path, required=True)
834
+ parser.add_argument("--overwrite", action="store_true")
835
+ return parser.parse_args()
836
+
837
+
838
+ if __name__ == "__main__":
839
+ build(parse_args())
scripts/evaluate_predictions.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Evaluate MDU-RiskBench participant-level prediction JSONL."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import gzip
8
+ import json
9
+ import math
10
+ from collections import Counter
11
+ from pathlib import Path
12
+
13
+ ORDER = {
14
+ "no_observed_risk": 0,
15
+ "mild_risk": 1,
16
+ "moderate_risk": 2,
17
+ "high_risk": 3,
18
+ }
19
+ ABSTAIN = "insufficient_evidence"
20
+
21
+
22
+ def read_jsonl(path: Path):
23
+ opener = gzip.open if path.suffix == ".gz" else open
24
+ with opener(path, "rt", encoding="utf-8") as handle:
25
+ for line in handle:
26
+ if line.strip():
27
+ yield json.loads(line)
28
+
29
+
30
+ def main() -> None:
31
+ parser = argparse.ArgumentParser()
32
+ parser.add_argument("--gold", type=Path, required=True)
33
+ parser.add_argument("--predictions", type=Path, required=True)
34
+ parser.add_argument("--output", type=Path)
35
+ args = parser.parse_args()
36
+
37
+ gold = {
38
+ row["sample_id"]: row["target_label"]["risk_level"]
39
+ for row in read_jsonl(args.gold)
40
+ }
41
+ pred = {row["sample_id"]: row["risk_level"] for row in read_jsonl(args.predictions)}
42
+ unknown = sorted(set(pred) - set(gold))
43
+ if unknown:
44
+ raise SystemExit(f"unknown prediction IDs: {unknown[:5]}")
45
+
46
+ labels = list(ORDER)
47
+ total = len(gold)
48
+ covered = [(gold[sid], pred.get(sid)) for sid in gold if pred.get(sid) in ORDER]
49
+ abstained = total - len(covered)
50
+ exact = sum(actual == predicted for actual, predicted in covered)
51
+ distances = [abs(ORDER[actual] - ORDER[predicted]) for actual, predicted in covered]
52
+ squared = [value * value for value in distances]
53
+ f1_values = []
54
+ for label in labels:
55
+ tp = sum(actual == label and predicted == label for actual, predicted in covered)
56
+ fp = sum(actual != label and predicted == label for actual, predicted in covered)
57
+ fn = sum(actual == label and predicted != label for actual, predicted in covered)
58
+ precision = tp / (tp + fp) if tp + fp else 0.0
59
+ recall = tp / (tp + fn) if tp + fn else 0.0
60
+ f1_values.append(
61
+ 2 * precision * recall / (precision + recall) if precision + recall else 0.0
62
+ )
63
+
64
+ n = len(covered)
65
+ report = {
66
+ "gold_records": total,
67
+ "prediction_records": len(pred),
68
+ "covered_records": n,
69
+ "abstained_or_missing_records": abstained,
70
+ "coverage": n / total if total else 0.0,
71
+ "selective_accuracy": exact / n if n else None,
72
+ "selective_macro_f1": sum(f1_values) / len(f1_values) if n else None,
73
+ "ordinal_mae": sum(distances) / n if n else None,
74
+ "ordinal_rmse": math.sqrt(sum(squared) / n) if n else None,
75
+ "prediction_distribution": dict(sorted(Counter(pred.values()).items())),
76
+ }
77
+ rendered = json.dumps(report, indent=2) + "\n"
78
+ if args.output:
79
+ args.output.write_text(rendered, encoding="utf-8")
80
+ print(rendered, end="")
81
+
82
+
83
+ if __name__ == "__main__":
84
+ main()
scripts/verify_release.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Verify MDU-RiskText/MDU-RiskBench row alignment and file hashes."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import gzip
7
+ import hashlib
8
+ import json
9
+ from collections import Counter
10
+ from pathlib import Path
11
+
12
+ ROOT = Path(__file__).resolve().parents[1]
13
+ SETTINGS = ("video_only", "non_video_only", "all_filtered_text")
14
+ SPLITS = ("train", "validation", "test")
15
+
16
+
17
+ def digest(path: Path) -> str:
18
+ value = hashlib.sha256()
19
+ with path.open("rb") as handle:
20
+ for chunk in iter(lambda: handle.read(1024 * 1024), b""):
21
+ value.update(chunk)
22
+ return value.hexdigest()
23
+
24
+
25
+ def rows(path: Path):
26
+ with gzip.open(path, "rt", encoding="utf-8") as handle:
27
+ for line in handle:
28
+ if line.strip():
29
+ yield json.loads(line)
30
+
31
+
32
+ def main() -> None:
33
+ manifest = json.loads((ROOT / "MANIFEST.json").read_text(encoding="utf-8"))
34
+ for entry in manifest["files"]:
35
+ path = ROOT / entry["path"]
36
+ if path.stat().st_size != entry["bytes"]:
37
+ raise SystemExit(f"size mismatch: {entry['path']}")
38
+ if digest(path) != entry["sha256"]:
39
+ raise SystemExit(f"hash mismatch: {entry['path']}")
40
+
41
+ identities = {}
42
+ for setting in SETTINGS:
43
+ current = {}
44
+ for split in SPLITS:
45
+ path = ROOT / "MDU-RiskText" / setting / f"{split}.jsonl.gz"
46
+ for row in rows(path):
47
+ if row["split"] != split or row["benchmark_setting"] != setting:
48
+ raise SystemExit(f"metadata mismatch: {path}")
49
+ package = row["llm_evidence_package"]
50
+ if package["sample_id"] != row["sample_id"]:
51
+ raise SystemExit(f"package ID mismatch: {row['sample_id']}")
52
+ if json.loads(row["text_evidence"]) != package:
53
+ raise SystemExit(f"text package mismatch: {row['sample_id']}")
54
+ current[row["sample_id"]] = (
55
+ split,
56
+ row["target_label"]["risk_level"],
57
+ )
58
+ if len(current) != 850:
59
+ raise SystemExit(f"{setting}: expected 850 records, got {len(current)}")
60
+ if identities and current != identities:
61
+ raise SystemExit(f"cross-setting identity mismatch: {setting}")
62
+ identities = current
63
+
64
+ split_counts = Counter(split for split, _ in identities.values())
65
+ label_counts = Counter(label for _, label in identities.values())
66
+ expected_splits = {"train": 593, "validation": 131, "test": 126}
67
+ expected_labels = {
68
+ "no_observed_risk": 226,
69
+ "mild_risk": 432,
70
+ "moderate_risk": 172,
71
+ "high_risk": 20,
72
+ }
73
+ if dict(split_counts) != expected_splits:
74
+ raise SystemExit(f"split counts differ: {dict(split_counts)}")
75
+ if dict(label_counts) != expected_labels:
76
+ raise SystemExit(f"label counts differ: {dict(label_counts)}")
77
+ print("Verified 850 aligned participants across 3 settings and 9 data files.")
78
+
79
+
80
+ if __name__ == "__main__":
81
+ main()