ghdgfxzfdz commited on
Commit
a2d1ad3
·
verified ·
1 Parent(s): 8b1871f

Refresh executable CB-Telemetry review artifact

Browse files

Add released bottleneck feature tables, executable retrieval evaluation scripts, refreshed archive checksum, and the Zenodo draft review link. Remove stale wav viewer files.

Files changed (38) hide show
  1. README.md +25 -20
  2. archive/cb_telemetry_v1_expert_aligned.tar.gz +2 -2
  3. archive/cb_telemetry_v1_expert_aligned.tar.gz.sha256 +1 -1
  4. audio_sample/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.m4a +0 -0
  5. audio_sample_wav/README.md +0 -3
  6. audio_sample_wav/chichibu/20120407/cbt_tetto_20120407_20120407053414tetto_clip.wav +0 -3
  7. audio_sample_wav/chichibu/20120407/cbt_tetto_20120407_20120407063415tetto_clip.wav +0 -3
  8. audio_sample_wav/chichibu/20120410/cbt_tetto_20120410_20120410053319tetto_clip.wav +0 -3
  9. audio_sample_wav/chichibu/20120410/cbt_tetto_20120410_20120410063320tetto_clip.wav +0 -3
  10. audio_sample_wav/chichibu/20120413/cbt_tetto_20120413_20120413050431tetto_clip.wav +0 -3
  11. audio_sample_wav/chichibu/20120413/cbt_tetto_20120413_20120413060432tetto_clip.wav +0 -3
  12. audio_sample_wav/chichibu/20120416/cbt_tetto_20120416_20120416070400tetto_clip.wav +0 -3
  13. audio_sample_wav/chichibu/20120425/cbt_tetto_20120425_20120425050327tetto_clip.wav +0 -3
  14. audio_sample_wav/furano/20200403/cbt_maeyama_20200403_20200403053159maeyama_clip.wav +0 -3
  15. audio_sample_wav/furano/20200411/cbt_maeyama_20200411_20200411053201maeyama_clip.wav +0 -3
  16. audio_sample_wav/furano/20200417/cbt_maeyama_20200417_20200417043209maeyama_clip.wav +0 -3
  17. audio_sample_wav/metadata.csv +0 -25
  18. audio_sample_wav/shiga/20200403/cbt_otanomo_20200403_20200403051249otanomo_clip.wav +0 -3
  19. audio_sample_wav/shiga/20200403/cbt_otanomo_20200403_20200403061257otanomo_clip.wav +0 -3
  20. audio_sample_wav/shiga/20200620/cbt_otanomo_20200620_20200620040430otanomo_clip.wav +0 -3
  21. audio_sample_wav/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.wav +0 -3
  22. audio_sample_wav/yamanakako/20150402/cbt_yamanakako_old_20150402_20150402055817yamanakako_clip.wav +0 -3
  23. audio_sample_wav/yamanakako/20160628/cbt_yamanakako_old_20160628_20160628054404yamanakako_clip.wav +0 -3
  24. audio_sample_wav/yatake/20120403/cbt_yatake_old_20120403_20120403061005yatake_clip.wav +0 -3
  25. audio_sample_wav/yatake/20120430/cbt_yatake_old_20120430_20120430045616yatake_clip.wav +0 -3
  26. audio_sample_wav/yatake/20140611/cbt_yatake_old_20140611_20140611040745yatake_clip.wav +0 -3
  27. audio_sample_wav/chichibu/20120404/cbt_tetto_20120404_20120404063333tetto_clip.wav → features/bottlenecks/default/opq_8bit_feature_table.csv.gz +2 -2
  28. audio_sample_wav/chichibu/20120401/cbt_tetto_20120401_20120401053323tetto_clip.wav → features/bottlenecks/default/pq_8bit_feature_table.csv.gz +2 -2
  29. audio_sample_wav/chichibu/20120401/cbt_tetto_20120401_20120401063324tetto_clip.wav → features/bottlenecks/default/standard_rvq_8bit_feature_table.csv.gz +2 -2
  30. audio_sample_wav/chichibu/20120404/cbt_tetto_20120404_20120404053332tetto_clip.wav → features/bottlenecks/strict_clean/opq_8bit_feature_table.csv.gz +2 -2
  31. features/bottlenecks/strict_clean/pq_8bit_feature_table.csv.gz +3 -0
  32. features/bottlenecks/strict_clean/standard_rvq_8bit_feature_table.csv.gz +3 -0
  33. hf_staging_validation.json +3 -3
  34. metadata.csv +24 -24
  35. requirements.txt +4 -0
  36. scripts/run_release_evaluation.py +366 -0
  37. scripts/run_retrieval_eval.py +629 -0
  38. scripts/validate_cb_telemetry.py +15 -6
README.md CHANGED
@@ -21,11 +21,10 @@ size_categories:
21
  - n<1K
22
  configs:
23
  - config_name: reviewer_audio
24
- data_dir: audio_sample_wav
25
  data_files:
26
  - split: train
27
- path: "**/*.wav"
28
- drop_labels: true
29
  default: true
30
  ---
31
 
@@ -38,10 +37,11 @@ archive is preserved on Zenodo:
38
 
39
  [https://doi.org/10.5281/zenodo.19951359](https://doi.org/10.5281/zenodo.19951359)
40
 
41
- The immutable v1 archive is preserved on Zenodo.
42
-
43
- ⚠️ Note for Reviewers: The permanent DOI (10.5281/zenodo.19951359) is currently reserved and will resolve upon camera-ready publication. During the double-blind review phase, please access the frozen draft archive using this anonymized secret link:
44
- https://zenodo.org/records/19951359?preview=1&token=eyJhbGciOiJIUzUxMiJ9.eyJpZCI6IjgyMTMzMjc2LTQ1ZGYtNDM5MC1hZWQ0LTA0MDUwN2U5NTIzYyIsImRhdGEiOnt9LCJyYW5kb20iOiJjYjUxMzE1NDMwM2IxMDYzMjU3MTAzYzVhOTk0M2NjNCJ9.vFOFfG_HYwC1BDsesFQzwGOevxXbin5FaJ7y4nutnam61ch0HoQEdR4Jl8U4UnTDZA9ghw2ps2HOOfkdJx9z2g
 
45
 
46
  ## What Is Hosted Here
47
 
@@ -51,6 +51,7 @@ This repository contains the lightweight ML-ready benchmark package:
51
  - frozen v1 scored manifests with 805 expert-overlap recording rows;
52
  - paired Default and Strict-Clean split metadata;
53
  - frozen Default and Strict-Clean feature tables;
 
54
  - refreshed representation, retrieval, metadata-control, and bottleneck
55
  baseline outputs;
56
  - validation and smoke-test scripts;
@@ -68,20 +69,18 @@ reconstructing the complete source-audio set from Cyberforest URLs.
68
  ## Reviewer Audio Viewer
69
 
70
  The default Hugging Face viewer is configured for the reviewer audio sample in
71
- `audio_sample_wav/`. These WAV files are HF-viewer-friendly transcodes of the
72
- same 24 M4A reviewer clips retained in `audio_sample/`. The viewer split can be
73
- loaded locally with:
74
 
75
  ```python
76
  from datasets import load_dataset
77
 
78
- samples = load_dataset("audiofolder", data_dir="audio_sample_wav")
79
  print(samples)
80
  ```
81
 
82
  The root-level `metadata.csv` points to the same 24 clips with paths relative to
83
- the repository root. The `audio_sample_wav/metadata.csv` file points to the WAV
84
- clips relative to `audio_sample_wav/`, following the AudioFolder convention.
85
 
86
  ## Benchmark Package Quickstart
87
 
@@ -92,6 +91,17 @@ python3 scripts/run_smoke_eval.py --root .
92
  python3 scripts/validate_cb_telemetry.py --root . --write-report
93
  ```
94
 
 
 
 
 
 
 
 
 
 
 
 
95
  To reconstruct the complete Default source-audio set:
96
 
97
  ```bash
@@ -120,7 +130,7 @@ The exact frozen v1 archive uploaded to Zenodo is also included under
120
  `archive/`:
121
 
122
  ```text
123
- 427973cb4aa907f4b7d14c425ce8194f7534c5461f0ea94a481503527665f430 cb_telemetry_v1_expert_aligned.tar.gz
124
  ```
125
 
126
  The Zenodo DOI for the immutable v1 artifact is:
@@ -128,11 +138,7 @@ The Zenodo DOI for the immutable v1 artifact is:
128
  ```text
129
  10.5281/zenodo.19951359
130
  ```
131
- Reviewer Access:
132
- Because this project is under double-blind peer review, the official Zenodo record remains an unpublished draft. The DOI (10.5281/zenodo.19951359) is reserved in the metadata but will return a 404 until de-anonymization.
133
 
134
- To download the exact cb_telemetry_v1_expert_aligned.tar.gz archive, please use the anonymous preview link:
135
- https://zenodo.org/records/19951359?preview=1&token=eyJhbGciOiJIUzUxMiJ9.eyJpZCI6IjgyMTMzMjc2LTQ1ZGYtNDM5MC1hZWQ0LTA0MDUwN2U5NTIzYyIsImRhdGEiOnt9LCJyYW5kb20iOiJjYjUxMzE1NDMwM2IxMDYzMjU3MTAzYzVhOTk0M2NjNCJ9.vFOFfG_HYwC1BDsesFQzwGOevxXbin5FaJ7y4nutnam61ch0HoQEdR4Jl8U4UnTDZA9ghw2ps2HOOfkdJx9z2g
136
  ## Provenance and Licensing
137
 
138
  The combined CB-Telemetry package is distributed under CC BY-NC-SA 4.0.
@@ -172,8 +178,7 @@ breeding-season-centered protocol.
172
 
173
  ```text
174
  annotations/ normalized J-STAGE expert listening records
175
- audio_sample/ 24 short M4A clips plus metadata
176
- audio_sample_wav/ 24 short WAV clips for the Hugging Face Dataset Viewer
177
  baselines/ refreshed public baseline outputs
178
  features/ frozen Default and Strict-Clean feature tables
179
  manifests/ scored snapshot, split, audio, and sample manifests
 
21
  - n<1K
22
  configs:
23
  - config_name: reviewer_audio
24
+ data_dir: audio_sample
25
  data_files:
26
  - split: train
27
+ path: "**/*.m4a"
 
28
  default: true
29
  ---
30
 
 
37
 
38
  [https://doi.org/10.5281/zenodo.19951359](https://doi.org/10.5281/zenodo.19951359)
39
 
40
+ **Note for reviewers:** The permanent DOI (`10.5281/zenodo.19951359`)
41
+ is currently reserved and will resolve upon camera-ready publication. During
42
+ the double-blind review phase, please access the frozen draft archive using
43
+ this anonymized secret link:
44
+ [https://zenodo.org/records/19951359?preview=1&token=eyJhbGciOiJIUzUxMiJ9.eyJpZCI6IjgyMTMzMjc2LTQ1ZGYtNDM5MC1hZWQ0LTA0MDUwN2U5NTIzYyIsImRhdGEiOnt9LCJyYW5kb20iOiJjYjUxMzE1NDMwM2IxMDYzMjU3MTAzYzVhOTk0M2NjNCJ9.vFOFfG_HYwC1BDsesFQzwGOevxXbin5FaJ7y4nutnam61ch0HoQEdR4Jl8U4UnTDZA9ghw2ps2HOOfkdJx9z2g](https://zenodo.org/records/19951359?preview=1&token=eyJhbGciOiJIUzUxMiJ9.eyJpZCI6IjgyMTMzMjc2LTQ1ZGYtNDM5MC1hZWQ0LTA0MDUwN2U5NTIzYyIsImRhdGEiOnt9LCJyYW5kb20iOiJjYjUxMzE1NDMwM2IxMDYzMjU3MTAzYzVhOTk0M2NjNCJ9.vFOFfG_HYwC1BDsesFQzwGOevxXbin5FaJ7y4nutnam61ch0HoQEdR4Jl8U4UnTDZA9ghw2ps2HOOfkdJx9z2g).
45
 
46
  ## What Is Hosted Here
47
 
 
51
  - frozen v1 scored manifests with 805 expert-overlap recording rows;
52
  - paired Default and Strict-Clean split metadata;
53
  - frozen Default and Strict-Clean feature tables;
54
+ - released RVQ/PQ/OPQ bottleneck feature tables for metric recomputation;
55
  - refreshed representation, retrieval, metadata-control, and bottleneck
56
  baseline outputs;
57
  - validation and smoke-test scripts;
 
69
  ## Reviewer Audio Viewer
70
 
71
  The default Hugging Face viewer is configured for the reviewer audio sample in
72
+ `audio_sample/`. The same files can be loaded locally with:
 
 
73
 
74
  ```python
75
  from datasets import load_dataset
76
 
77
+ samples = load_dataset("audiofolder", data_dir="audio_sample")
78
  print(samples)
79
  ```
80
 
81
  The root-level `metadata.csv` points to the same 24 clips with paths relative to
82
+ the repository root. The `audio_sample/metadata.csv` file points to the clips
83
+ relative to `audio_sample/`, following the AudioFolder convention.
84
 
85
  ## Benchmark Package Quickstart
86
 
 
91
  python3 scripts/validate_cb_telemetry.py --root . --write-report
92
  ```
93
 
94
+ The companion code release can recompute the released retrieval and
95
+ shortcut-control tables from this repository with:
96
+
97
+ ```bash
98
+ python3 -m pip install -r requirements.txt
99
+ python3 scripts/run_release_evaluation.py --root . --bootstrap-samples 2000
100
+ ```
101
+
102
+ The recomputation uses the continuous feature tables and the released
103
+ source-frozen bottleneck feature tables under `features/bottlenecks/`.
104
+
105
  To reconstruct the complete Default source-audio set:
106
 
107
  ```bash
 
130
  `archive/`:
131
 
132
  ```text
133
+ 701ad48d75ff34fabce82ee27271579f2ad83345a74a13468891beb0c6dc8f36 cb_telemetry_v1_expert_aligned.tar.gz
134
  ```
135
 
136
  The Zenodo DOI for the immutable v1 artifact is:
 
138
  ```text
139
  10.5281/zenodo.19951359
140
  ```
 
 
141
 
 
 
142
  ## Provenance and Licensing
143
 
144
  The combined CB-Telemetry package is distributed under CC BY-NC-SA 4.0.
 
178
 
179
  ```text
180
  annotations/ normalized J-STAGE expert listening records
181
+ audio_sample/ 24 short M4A clips plus AudioFolder metadata
 
182
  baselines/ refreshed public baseline outputs
183
  features/ frozen Default and Strict-Clean feature tables
184
  manifests/ scored snapshot, split, audio, and sample manifests
archive/cb_telemetry_v1_expert_aligned.tar.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:427973cb4aa907f4b7d14c425ce8194f7534c5461f0ea94a481503527665f430
3
- size 28857186
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:701ad48d75ff34fabce82ee27271579f2ad83345a74a13468891beb0c6dc8f36
3
+ size 48368883
archive/cb_telemetry_v1_expert_aligned.tar.gz.sha256 CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fa1f14f570f6ff2cd7179c1e804c007fa9407d8d6073e07bc3f01f9d432ba249
3
  size 104
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e7027fda93a0d3e5aabcc87de8aab7a7e9857aaa6cd980a2ebe1e9ef110f896
3
  size 104
audio_sample/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.m4a CHANGED
Binary files a/audio_sample/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.m4a and b/audio_sample/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.m4a differ
 
audio_sample_wav/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Reviewer Audio Sample WAV Split
2
-
3
- This directory contains 16 kHz mono WAV transcodes of the 24 reviewer audio clips for the Hugging Face Dataset Viewer. The original M4A clips are retained in `audio_sample/`.
 
 
 
 
audio_sample_wav/chichibu/20120407/cbt_tetto_20120407_20120407053414tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:03acaad52ada9d573ad138d80eb31a840368a129c1e9c99db8577b8d91f47dd4
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120407/cbt_tetto_20120407_20120407063415tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ee8cfe8cc6c00d2bc4c158c22ce0c926be68174501ca5a3a4a6bcaf23edab987
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120410/cbt_tetto_20120410_20120410053319tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:033e47eda01f404b5e1e95c9d98887a05c919c1ac0f9338ae2518a1745fd7b0c
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120410/cbt_tetto_20120410_20120410063320tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ada0bc4fda0c5c6363f8028805e877654b505c629f4d3d987a23ce2ab77bfa15
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120413/cbt_tetto_20120413_20120413050431tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:9cf2f01df553cabf4d7b157f0707dd1aa49c23b55c59c73264945cc2c08580f8
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120413/cbt_tetto_20120413_20120413060432tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c4aeefe5e0dfd3e67a973928763ad62dd9a4b16b46fdb9f789e5e40034dff8db
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120416/cbt_tetto_20120416_20120416070400tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c96d7bfc27fca1f63345eea280d5371f36322027bf1dd17c676460f335128329
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120425/cbt_tetto_20120425_20120425050327tetto_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:217413d30c3321414fea31f8f4c282d33ae162d42dba66d5df8fe257fbed5b8e
3
- size 260096
 
 
 
 
audio_sample_wav/furano/20200403/cbt_maeyama_20200403_20200403053159maeyama_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:510427186d020db8cb7e13d2d5bb32f90067f0de3a8432546b445ff2ace48608
3
- size 260096
 
 
 
 
audio_sample_wav/furano/20200411/cbt_maeyama_20200411_20200411053201maeyama_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e9ff140472ae190804b71e7c4cf58321a0b7f5aa957c7743af7a957ee87ed1b
3
- size 260096
 
 
 
 
audio_sample_wav/furano/20200417/cbt_maeyama_20200417_20200417043209maeyama_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4602f05bc6ebbc45eb458b7dad37429243353c2a740d8d63dca9ae04c18386fd
3
- size 260096
 
 
 
 
audio_sample_wav/metadata.csv DELETED
@@ -1,25 +0,0 @@
1
- file_name,recording_id,site_en,date,year,behavior_types,jstage_event_count,jstage_species_count,clip_start_sec,clip_duration_sec,segment_start_sec,segment_end_sec,source_audio_license,source_annotation_doi
2
- chichibu/20120425/cbt_tetto_20120425_20120425050327tetto_clip.wav,cbt_tetto_20120425_20120425050327tetto,Chichibu,20120425,2012,C|D|S,250,16,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
3
- furano/20200403/cbt_maeyama_20200403_20200403053159maeyama_clip.wav,cbt_maeyama_20200403_20200403053159maeyama,Furano,20200403,2020,C|D|S,70,10,2370.388,8.0,2373.138,2375.638,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
4
- shiga/20200403/cbt_otanomo_20200403_20200403061257otanomo_clip.wav,cbt_otanomo_20200403_20200403061257otanomo,Shiga,20200403,2020,C|D|S,83,10,775.312,8.0,779.026,779.598,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
5
- yamanakako/20150402/cbt_yamanakako_old_20150402_20150402055817yamanakako_clip.wav,cbt_yamanakako_old_20150402_20150402055817yamanakako,Yamanakako,20150402,2015,C|D|S,208,17,2164.752,8.0,2167.502,2170.002,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
6
- yatake/20120430/cbt_yatake_old_20120430_20120430045616yatake_clip.wav,cbt_yatake_old_20120430_20120430045616yatake,Yatake,20120430,2012,C|D|S,224,20,3100.528,8.0,3104.162,3104.894,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
7
- chichibu/20120401/cbt_tetto_20120401_20120401053323tetto_clip.wav,cbt_tetto_20120401_20120401053323tetto,Chichibu,20120401,2012,C|S,69,7,361.476,8.0,364.226,366.726,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
8
- furano/20200411/cbt_maeyama_20200411_20200411053201maeyama_clip.wav,cbt_maeyama_20200411_20200411053201maeyama,Furano,20200411,2020,C|S,91,10,2059.272,8.0,2062.022,2064.522,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
9
- shiga/20200403/cbt_otanomo_20200403_20200403051249otanomo_clip.wav,cbt_otanomo_20200403_20200403051249otanomo,Shiga,20200403,2020,C,2,1,540.144,8.0,542.894,545.394,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
10
- yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.wav,cbt_yamanakako_old_20140402_20140402060501yamanakako,Yamanakako,20140402,2014,C|S,15,8,104.75,8.0,107.5,110.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
11
- yatake/20120403/cbt_yatake_old_20120403_20120403061005yatake_clip.wav,cbt_yatake_old_20120403_20120403061005yatake,Yatake,20120403,2012,C|S,43,6,702.25,8.0,705.0,707.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
12
- chichibu/20120416/cbt_tetto_20120416_20120416070400tetto_clip.wav,cbt_tetto_20120416_20120416070400tetto,Chichibu,20120416,2012,S,2,2,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
13
- furano/20200417/cbt_maeyama_20200417_20200417043209maeyama_clip.wav,cbt_maeyama_20200417_20200417043209maeyama,Furano,20200417,2020,S,19,4,1669.752,8.0,1672.502,1675.002,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
14
- shiga/20200620/cbt_otanomo_20200620_20200620040430otanomo_clip.wav,cbt_otanomo_20200620_20200620040430otanomo,Shiga,20200620,2020,S,4,2,2895.72,8.0,2899.634,2899.806,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
15
- yamanakako/20160628/cbt_yamanakako_old_20160628_20160628054404yamanakako_clip.wav,cbt_yamanakako_old_20160628_20160628054404yamanakako,Yamanakako,20160628,2016,S,27,1,3119.75,8.0,3122.5,3125.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
16
- yatake/20140611/cbt_yatake_old_20140611_20140611040745yatake_clip.wav,cbt_yatake_old_20140611_20140611040745yatake,Yatake,20140611,2014,S,24,7,162.25,8.0,165.0,167.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
17
- chichibu/20120401/cbt_tetto_20120401_20120401063324tetto_clip.wav,cbt_tetto_20120401_20120401063324tetto,Chichibu,20120401,2012,C|S,176,12,1477.25,8.0,1480.0,1482.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
18
- chichibu/20120404/cbt_tetto_20120404_20120404053332tetto_clip.wav,cbt_tetto_20120404_20120404053332tetto,Chichibu,20120404,2012,C|S,100,10,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
19
- chichibu/20120404/cbt_tetto_20120404_20120404063333tetto_clip.wav,cbt_tetto_20120404_20120404063333tetto,Chichibu,20120404,2012,C|S,113,11,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
20
- chichibu/20120407/cbt_tetto_20120407_20120407053414tetto_clip.wav,cbt_tetto_20120407_20120407053414tetto,Chichibu,20120407,2012,C|S,109,9,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
21
- chichibu/20120407/cbt_tetto_20120407_20120407063415tetto_clip.wav,cbt_tetto_20120407_20120407063415tetto,Chichibu,20120407,2012,C|S,100,12,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
22
- chichibu/20120410/cbt_tetto_20120410_20120410053319tetto_clip.wav,cbt_tetto_20120410_20120410053319tetto,Chichibu,20120410,2012,C|S,24,7,322.25,8.0,325.0,327.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
23
- chichibu/20120410/cbt_tetto_20120410_20120410063320tetto_clip.wav,cbt_tetto_20120410_20120410063320tetto,Chichibu,20120410,2012,C|S,115,12,1294.75,8.0,1297.5,1300.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
24
- chichibu/20120413/cbt_tetto_20120413_20120413050431tetto_clip.wav,cbt_tetto_20120413_20120413050431tetto,Chichibu,20120413,2012,C|S,103,11,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
25
- chichibu/20120413/cbt_tetto_20120413_20120413060432tetto_clip.wav,cbt_tetto_20120413_20120413060432tetto,Chichibu,20120413,2012,C|S,236,16,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
audio_sample_wav/shiga/20200403/cbt_otanomo_20200403_20200403051249otanomo_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5b6e6f8b94590776c6be3d627e18aca6f7b75e637a48860ecb45f96fab76d693
3
- size 260096
 
 
 
 
audio_sample_wav/shiga/20200403/cbt_otanomo_20200403_20200403061257otanomo_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:01afa600dd7172988d57ae8d5f63820d6058487d9c1d31f7ccac1e8563a3c5ad
3
- size 260096
 
 
 
 
audio_sample_wav/shiga/20200620/cbt_otanomo_20200620_20200620040430otanomo_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ba8c64f4128c8bb093986ddab150de120cc49662a3ba3234b738d1b718a32c2f
3
- size 260096
 
 
 
 
audio_sample_wav/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f79c075a2ea3b55edc83c3781ac187dc21f903701c3ee3670a687796a71807e7
3
- size 260096
 
 
 
 
audio_sample_wav/yamanakako/20150402/cbt_yamanakako_old_20150402_20150402055817yamanakako_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6a1efb4c8bf7168732577749ade21fd2da5bac258289884aacea65ec48b385b4
3
- size 260096
 
 
 
 
audio_sample_wav/yamanakako/20160628/cbt_yamanakako_old_20160628_20160628054404yamanakako_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4516bf37ab15384f602c460dd3792b48dd3f45f6d318979aeed99e2545bd11ab
3
- size 260096
 
 
 
 
audio_sample_wav/yatake/20120403/cbt_yatake_old_20120403_20120403061005yatake_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:85ed5b7466698d5d2c5fc94df52a7f97afd9feca239384598b71429f0edb2c88
3
- size 260096
 
 
 
 
audio_sample_wav/yatake/20120430/cbt_yatake_old_20120430_20120430045616yatake_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:606b3f6649c15cb580c5a077a30bfc5c64fb82d2e57294b3286c336b44af185a
3
- size 260096
 
 
 
 
audio_sample_wav/yatake/20140611/cbt_yatake_old_20140611_20140611040745yatake_clip.wav DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:757dbb540ace49fc8c20587e12b8b8eb63f88d065e7e8ca8d910aa05b917f38b
3
- size 260096
 
 
 
 
audio_sample_wav/chichibu/20120404/cbt_tetto_20120404_20120404063333tetto_clip.wav → features/bottlenecks/default/opq_8bit_feature_table.csv.gz RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:541d7a355348fc01523bfb0d81101c24a37cdcf1cc009b5d06c3c4e93a74457a
3
- size 260096
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3359d5af297ab7cee9fab04aa0a9327e0f6370dcb89322d6ae04bbda6f1f265
3
+ size 4456952
audio_sample_wav/chichibu/20120401/cbt_tetto_20120401_20120401053323tetto_clip.wav → features/bottlenecks/default/pq_8bit_feature_table.csv.gz RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:140c9986636b05220e582c498cc3eede5e3e60f9d8d30cbb4d9bb61858573276
3
- size 260096
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57ed5dbe3466c44db6b9b64d25401666d80c97ad875cdc5cf510a4e9e2007e36
3
+ size 3474233
audio_sample_wav/chichibu/20120401/cbt_tetto_20120401_20120401063324tetto_clip.wav → features/bottlenecks/default/standard_rvq_8bit_feature_table.csv.gz RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:63ab1ec5626c1f4e4adc2c837f9f11335a9b60fb6b49e0469245c3b1e14a3190
3
- size 260096
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47cb104bcdfe52a3b3117777d7bf81519cf21945d0c6e8aaa4459f81a0ec4d5b
3
+ size 4684598
audio_sample_wav/chichibu/20120404/cbt_tetto_20120404_20120404053332tetto_clip.wav → features/bottlenecks/strict_clean/opq_8bit_feature_table.csv.gz RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8bf7d6d72122d968721db6c1f6b8f5883264480b4b0b91ec0b4839af2c1f9765
3
- size 260096
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1dffda743db376217bd27cdd394a25bb04c5b2634ff96c1d779676afae5fb05
3
+ size 2484906
features/bottlenecks/strict_clean/pq_8bit_feature_table.csv.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22c3cbd4c1e19dd145aa89d17a32a955a259a257297403220c79065204a702eb
3
+ size 1908955
features/bottlenecks/strict_clean/standard_rvq_8bit_feature_table.csv.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c41b83e8fabe004886e55e05451882514b79292112b1e026e9e3e35dd92fdb21
3
+ size 2760058
hf_staging_validation.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "status": "pass",
3
- "root": "hf_cb_telemetry_v1_wav",
4
  "reviewer_audio_rows": 24,
5
  "reviewer_audio_sites": [
6
  "Chichibu",
@@ -15,9 +15,9 @@
15
  "S"
16
  ],
17
  "zenodo_doi": "10.5281/zenodo.19951359",
18
- "archive_sha256": "427973cb4aa907f4b7d14c425ce8194f7534c5461f0ea94a481503527665f430",
19
  "archive_stats": {
20
- "members": 87,
21
  "ds_store": 0,
22
  "macosx": 0
23
  }
 
1
  {
2
  "status": "pass",
3
+ "root": "hf_cb_telemetry_v1",
4
  "reviewer_audio_rows": 24,
5
  "reviewer_audio_sites": [
6
  "Chichibu",
 
15
  "S"
16
  ],
17
  "zenodo_doi": "10.5281/zenodo.19951359",
18
+ "archive_sha256": "701ad48d75ff34fabce82ee27271579f2ad83345a74a13468891beb0c6dc8f36",
19
  "archive_stats": {
20
+ "members": 99,
21
  "ds_store": 0,
22
  "macosx": 0
23
  }
metadata.csv CHANGED
@@ -1,25 +1,25 @@
1
  file_name,recording_id,site_en,date,year,behavior_types,jstage_event_count,jstage_species_count,clip_start_sec,clip_duration_sec,segment_start_sec,segment_end_sec,source_audio_license,source_annotation_doi
2
- audio_sample_wav/chichibu/20120425/cbt_tetto_20120425_20120425050327tetto_clip.wav,cbt_tetto_20120425_20120425050327tetto,Chichibu,20120425,2012,C|D|S,250,16,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
3
- audio_sample_wav/furano/20200403/cbt_maeyama_20200403_20200403053159maeyama_clip.wav,cbt_maeyama_20200403_20200403053159maeyama,Furano,20200403,2020,C|D|S,70,10,2370.388,8.0,2373.138,2375.638,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
4
- audio_sample_wav/shiga/20200403/cbt_otanomo_20200403_20200403061257otanomo_clip.wav,cbt_otanomo_20200403_20200403061257otanomo,Shiga,20200403,2020,C|D|S,83,10,775.312,8.0,779.026,779.598,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
5
- audio_sample_wav/yamanakako/20150402/cbt_yamanakako_old_20150402_20150402055817yamanakako_clip.wav,cbt_yamanakako_old_20150402_20150402055817yamanakako,Yamanakako,20150402,2015,C|D|S,208,17,2164.752,8.0,2167.502,2170.002,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
6
- audio_sample_wav/yatake/20120430/cbt_yatake_old_20120430_20120430045616yatake_clip.wav,cbt_yatake_old_20120430_20120430045616yatake,Yatake,20120430,2012,C|D|S,224,20,3100.528,8.0,3104.162,3104.894,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
7
- audio_sample_wav/chichibu/20120401/cbt_tetto_20120401_20120401053323tetto_clip.wav,cbt_tetto_20120401_20120401053323tetto,Chichibu,20120401,2012,C|S,69,7,361.476,8.0,364.226,366.726,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
8
- audio_sample_wav/furano/20200411/cbt_maeyama_20200411_20200411053201maeyama_clip.wav,cbt_maeyama_20200411_20200411053201maeyama,Furano,20200411,2020,C|S,91,10,2059.272,8.0,2062.022,2064.522,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
9
- audio_sample_wav/shiga/20200403/cbt_otanomo_20200403_20200403051249otanomo_clip.wav,cbt_otanomo_20200403_20200403051249otanomo,Shiga,20200403,2020,C,2,1,540.144,8.0,542.894,545.394,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
10
- audio_sample_wav/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.wav,cbt_yamanakako_old_20140402_20140402060501yamanakako,Yamanakako,20140402,2014,C|S,15,8,104.75,8.0,107.5,110.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
11
- audio_sample_wav/yatake/20120403/cbt_yatake_old_20120403_20120403061005yatake_clip.wav,cbt_yatake_old_20120403_20120403061005yatake,Yatake,20120403,2012,C|S,43,6,702.25,8.0,705.0,707.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
12
- audio_sample_wav/chichibu/20120416/cbt_tetto_20120416_20120416070400tetto_clip.wav,cbt_tetto_20120416_20120416070400tetto,Chichibu,20120416,2012,S,2,2,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
13
- audio_sample_wav/furano/20200417/cbt_maeyama_20200417_20200417043209maeyama_clip.wav,cbt_maeyama_20200417_20200417043209maeyama,Furano,20200417,2020,S,19,4,1669.752,8.0,1672.502,1675.002,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
14
- audio_sample_wav/shiga/20200620/cbt_otanomo_20200620_20200620040430otanomo_clip.wav,cbt_otanomo_20200620_20200620040430otanomo,Shiga,20200620,2020,S,4,2,2895.72,8.0,2899.634,2899.806,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
15
- audio_sample_wav/yamanakako/20160628/cbt_yamanakako_old_20160628_20160628054404yamanakako_clip.wav,cbt_yamanakako_old_20160628_20160628054404yamanakako,Yamanakako,20160628,2016,S,27,1,3119.75,8.0,3122.5,3125.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
16
- audio_sample_wav/yatake/20140611/cbt_yatake_old_20140611_20140611040745yatake_clip.wav,cbt_yatake_old_20140611_20140611040745yatake,Yatake,20140611,2014,S,24,7,162.25,8.0,165.0,167.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
17
- audio_sample_wav/chichibu/20120401/cbt_tetto_20120401_20120401063324tetto_clip.wav,cbt_tetto_20120401_20120401063324tetto,Chichibu,20120401,2012,C|S,176,12,1477.25,8.0,1480.0,1482.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
18
- audio_sample_wav/chichibu/20120404/cbt_tetto_20120404_20120404053332tetto_clip.wav,cbt_tetto_20120404_20120404053332tetto,Chichibu,20120404,2012,C|S,100,10,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
19
- audio_sample_wav/chichibu/20120404/cbt_tetto_20120404_20120404063333tetto_clip.wav,cbt_tetto_20120404_20120404063333tetto,Chichibu,20120404,2012,C|S,113,11,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
20
- audio_sample_wav/chichibu/20120407/cbt_tetto_20120407_20120407053414tetto_clip.wav,cbt_tetto_20120407_20120407053414tetto,Chichibu,20120407,2012,C|S,109,9,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
21
- audio_sample_wav/chichibu/20120407/cbt_tetto_20120407_20120407063415tetto_clip.wav,cbt_tetto_20120407_20120407063415tetto,Chichibu,20120407,2012,C|S,100,12,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
22
- audio_sample_wav/chichibu/20120410/cbt_tetto_20120410_20120410053319tetto_clip.wav,cbt_tetto_20120410_20120410053319tetto,Chichibu,20120410,2012,C|S,24,7,322.25,8.0,325.0,327.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
23
- audio_sample_wav/chichibu/20120410/cbt_tetto_20120410_20120410063320tetto_clip.wav,cbt_tetto_20120410_20120410063320tetto,Chichibu,20120410,2012,C|S,115,12,1294.75,8.0,1297.5,1300.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
24
- audio_sample_wav/chichibu/20120413/cbt_tetto_20120413_20120413050431tetto_clip.wav,cbt_tetto_20120413_20120413050431tetto,Chichibu,20120413,2012,C|S,103,11,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
25
- audio_sample_wav/chichibu/20120413/cbt_tetto_20120413_20120413060432tetto_clip.wav,cbt_tetto_20120413_20120413060432tetto,Chichibu,20120413,2012,C|S,236,16,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
 
1
  file_name,recording_id,site_en,date,year,behavior_types,jstage_event_count,jstage_species_count,clip_start_sec,clip_duration_sec,segment_start_sec,segment_end_sec,source_audio_license,source_annotation_doi
2
+ audio_sample/chichibu/20120425/cbt_tetto_20120425_20120425050327tetto_clip.m4a,cbt_tetto_20120425_20120425050327tetto,Chichibu,20120425,2012,C|D|S,250,16,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
3
+ audio_sample/furano/20200403/cbt_maeyama_20200403_20200403053159maeyama_clip.m4a,cbt_maeyama_20200403_20200403053159maeyama,Furano,20200403,2020,C|D|S,70,10,2370.388,8.0,2373.138,2375.638,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
4
+ audio_sample/shiga/20200403/cbt_otanomo_20200403_20200403061257otanomo_clip.m4a,cbt_otanomo_20200403_20200403061257otanomo,Shiga,20200403,2020,C|D|S,83,10,775.312,8.0,779.026,779.598,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
5
+ audio_sample/yamanakako/20150402/cbt_yamanakako_old_20150402_20150402055817yamanakako_clip.m4a,cbt_yamanakako_old_20150402_20150402055817yamanakako,Yamanakako,20150402,2015,C|D|S,208,17,2164.752,8.0,2167.502,2170.002,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
6
+ audio_sample/yatake/20120430/cbt_yatake_old_20120430_20120430045616yatake_clip.m4a,cbt_yatake_old_20120430_20120430045616yatake,Yatake,20120430,2012,C|D|S,224,20,3100.528,8.0,3104.162,3104.894,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
7
+ audio_sample/chichibu/20120401/cbt_tetto_20120401_20120401053323tetto_clip.m4a,cbt_tetto_20120401_20120401053323tetto,Chichibu,20120401,2012,C|S,69,7,361.476,8.0,364.226,366.726,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
8
+ audio_sample/furano/20200411/cbt_maeyama_20200411_20200411053201maeyama_clip.m4a,cbt_maeyama_20200411_20200411053201maeyama,Furano,20200411,2020,C|S,91,10,2059.272,8.0,2062.022,2064.522,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
9
+ audio_sample/shiga/20200403/cbt_otanomo_20200403_20200403051249otanomo_clip.m4a,cbt_otanomo_20200403_20200403051249otanomo,Shiga,20200403,2020,C,2,1,540.144,8.0,542.894,545.394,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
10
+ audio_sample/yamanakako/20140402/cbt_yamanakako_old_20140402_20140402060501yamanakako_clip.m4a,cbt_yamanakako_old_20140402_20140402060501yamanakako,Yamanakako,20140402,2014,C|S,15,8,104.75,8.0,107.5,110.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
11
+ audio_sample/yatake/20120403/cbt_yatake_old_20120403_20120403061005yatake_clip.m4a,cbt_yatake_old_20120403_20120403061005yatake,Yatake,20120403,2012,C|S,43,6,702.25,8.0,705.0,707.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
12
+ audio_sample/chichibu/20120416/cbt_tetto_20120416_20120416070400tetto_clip.m4a,cbt_tetto_20120416_20120416070400tetto,Chichibu,20120416,2012,S,2,2,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
13
+ audio_sample/furano/20200417/cbt_maeyama_20200417_20200417043209maeyama_clip.m4a,cbt_maeyama_20200417_20200417043209maeyama,Furano,20200417,2020,S,19,4,1669.752,8.0,1672.502,1675.002,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
14
+ audio_sample/shiga/20200620/cbt_otanomo_20200620_20200620040430otanomo_clip.m4a,cbt_otanomo_20200620_20200620040430otanomo,Shiga,20200620,2020,S,4,2,2895.72,8.0,2899.634,2899.806,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
15
+ audio_sample/yamanakako/20160628/cbt_yamanakako_old_20160628_20160628054404yamanakako_clip.m4a,cbt_yamanakako_old_20160628_20160628054404yamanakako,Yamanakako,20160628,2016,S,27,1,3119.75,8.0,3122.5,3125.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
16
+ audio_sample/yatake/20140611/cbt_yatake_old_20140611_20140611040745yatake_clip.m4a,cbt_yatake_old_20140611_20140611040745yatake,Yatake,20140611,2014,S,24,7,162.25,8.0,165.0,167.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
17
+ audio_sample/chichibu/20120401/cbt_tetto_20120401_20120401063324tetto_clip.m4a,cbt_tetto_20120401_20120401063324tetto,Chichibu,20120401,2012,C|S,176,12,1477.25,8.0,1480.0,1482.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
18
+ audio_sample/chichibu/20120404/cbt_tetto_20120404_20120404053332tetto_clip.m4a,cbt_tetto_20120404_20120404053332tetto,Chichibu,20120404,2012,C|S,100,10,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
19
+ audio_sample/chichibu/20120404/cbt_tetto_20120404_20120404063333tetto_clip.m4a,cbt_tetto_20120404_20120404063333tetto,Chichibu,20120404,2012,C|S,113,11,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
20
+ audio_sample/chichibu/20120407/cbt_tetto_20120407_20120407053414tetto_clip.m4a,cbt_tetto_20120407_20120407053414tetto,Chichibu,20120407,2012,C|S,109,9,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
21
+ audio_sample/chichibu/20120407/cbt_tetto_20120407_20120407063415tetto_clip.m4a,cbt_tetto_20120407_20120407063415tetto,Chichibu,20120407,2012,C|S,100,12,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
22
+ audio_sample/chichibu/20120410/cbt_tetto_20120410_20120410053319tetto_clip.m4a,cbt_tetto_20120410_20120410053319tetto,Chichibu,20120410,2012,C|S,24,7,322.25,8.0,325.0,327.5,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
23
+ audio_sample/chichibu/20120410/cbt_tetto_20120410_20120410063320tetto_clip.m4a,cbt_tetto_20120410_20120410063320tetto,Chichibu,20120410,2012,C|S,115,12,1294.75,8.0,1297.5,1300.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
24
+ audio_sample/chichibu/20120413/cbt_tetto_20120413_20120413050431tetto_clip.m4a,cbt_tetto_20120413_20120413050431tetto,Chichibu,20120413,2012,C|S,103,11,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
25
+ audio_sample/chichibu/20120413/cbt_tetto_20120413_20120413060432tetto_clip.m4a,cbt_tetto_20120413_20120413060432tetto,Chichibu,20120413,2012,C|S,236,16,0.0,8.0,0.0,8.0,CC BY-NC-SA 4.0,10.57368/data.birdresearch.26499895
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # Python 3.9 or newer is recommended.
2
+ numpy>=1.23
3
+ pandas>=1.5
4
+ scikit-learn>=1.2
scripts/run_release_evaluation.py ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import csv
6
+ import json
7
+ import subprocess
8
+ import sys
9
+ from pathlib import Path
10
+ from typing import Any
11
+
12
+ import pandas as pd
13
+
14
+
15
+ DISPLAY_NAME = {
16
+ "continuous": "Continuous reference",
17
+ "standard_rvq_8bit": "standard RVQ 8-bit",
18
+ "pq_8bit": "PQ 8-bit",
19
+ "opq_8bit": "OPQ 8-bit",
20
+ "metadata_basic": "Metadata basic",
21
+ "metadata_calendar": "Metadata calendar",
22
+ "random_permuted_continuous": "Random-permuted continuous",
23
+ }
24
+
25
+ PUBLIC_METHODS = [
26
+ "continuous",
27
+ "standard_rvq_8bit",
28
+ "pq_8bit",
29
+ "opq_8bit",
30
+ "metadata_basic",
31
+ "metadata_calendar",
32
+ "random_permuted_continuous",
33
+ ]
34
+
35
+
36
+ def parse_args() -> argparse.Namespace:
37
+ parser = argparse.ArgumentParser(
38
+ description="Recompute the released CB-Telemetry retrieval and shortcut-control tables."
39
+ )
40
+ parser.add_argument("--root", default=".", help="CB-Telemetry dataset root.")
41
+ parser.add_argument("--output-dir", default="evaluation_runs/release_retrieval", help="Output directory under --root.")
42
+ parser.add_argument("--bootstrap-samples", type=int, default=2000, help="Bootstrap resamples.")
43
+ parser.add_argument("--bootstrap-seed", type=int, default=42, help="Bootstrap random seed.")
44
+ parser.add_argument("--random-seed", type=int, default=42, help="Random-permuted control seed.")
45
+ parser.add_argument("--include-gap2", action="store_true", help="Also run the supplemental gap=2 retrieval controls.")
46
+ parser.add_argument("--tolerance", type=float, default=5e-4, help="Rounded-table comparison tolerance.")
47
+ return parser.parse_args()
48
+
49
+
50
+ def resolve(root: Path, raw_path: str) -> Path:
51
+ path = Path(raw_path).expanduser()
52
+ if not path.is_absolute():
53
+ path = (root / path).resolve()
54
+ return path
55
+
56
+
57
+ def release_path(root: Path, path: Path) -> str:
58
+ try:
59
+ return path.resolve().relative_to(root).as_posix()
60
+ except ValueError:
61
+ return path.as_posix()
62
+
63
+
64
+ def track_feature_table(track: str) -> str:
65
+ return "features/feature_table_default.csv.gz" if track == "default" else "features/feature_table_strict_clean.csv.gz"
66
+
67
+
68
+ def bottleneck_representations(root: Path, track: str) -> list[str]:
69
+ result = []
70
+ for method in ["standard_rvq_8bit", "pq_8bit", "opq_8bit"]:
71
+ rel = f"features/bottlenecks/{track}/{method}_feature_table.csv.gz"
72
+ if (root / rel).exists():
73
+ result.append(f"{method}={rel}")
74
+ return result
75
+
76
+
77
+ def run_command(cmd: list[str]) -> None:
78
+ subprocess.run(cmd, check=True)
79
+
80
+
81
+ def run_retrieval_suite(
82
+ root: Path,
83
+ output_dir: Path,
84
+ bootstrap_samples: int,
85
+ bootstrap_seed: int,
86
+ random_seed: int,
87
+ include_gap2: bool,
88
+ ) -> list[dict[str, Any]]:
89
+ script = Path(__file__).resolve().parent / "run_retrieval_eval.py"
90
+ run_rows: list[dict[str, Any]] = []
91
+ gaps = [1, 2] if include_gap2 else [1]
92
+ for track in ["default", "strict_clean"]:
93
+ feature_table = track_feature_table(track)
94
+ representations = [f"continuous={feature_table}", *bottleneck_representations(root, track)]
95
+ for scope_label, archive_scope in [("global", "global"), ("same-archive", "same_archive_only")]:
96
+ for gap in gaps:
97
+ run_dir = output_dir / track / f"{archive_scope}_gap{gap}"
98
+ cmd = [
99
+ sys.executable,
100
+ script.as_posix(),
101
+ "--root",
102
+ root.as_posix(),
103
+ "--feature-table",
104
+ feature_table,
105
+ "--output-dir",
106
+ run_dir.as_posix(),
107
+ "--archive-scope",
108
+ archive_scope,
109
+ "--max-slot-gap",
110
+ str(gap),
111
+ "--bootstrap-samples",
112
+ str(bootstrap_samples),
113
+ "--bootstrap-seed",
114
+ str(bootstrap_seed),
115
+ "--random-seed",
116
+ str(random_seed),
117
+ "--include-metadata-controls",
118
+ ]
119
+ for item in representations:
120
+ cmd.extend(["--representation", item])
121
+ run_command(cmd)
122
+ run_rows.append(
123
+ {
124
+ "track": track,
125
+ "scope": scope_label,
126
+ "gap": gap,
127
+ "archive_scope": archive_scope,
128
+ "summary_json_path": (run_dir / "summary.json").as_posix(),
129
+ "summary_json": release_path(root, run_dir / "summary.json"),
130
+ }
131
+ )
132
+ return run_rows
133
+
134
+
135
+ def load_json(path: Path) -> dict[str, Any]:
136
+ return json.loads(path.read_text(encoding="utf-8"))
137
+
138
+
139
+ def build_overview(run_rows: list[dict[str, Any]]) -> pd.DataFrame:
140
+ rows: list[dict[str, Any]] = []
141
+ for run in run_rows:
142
+ summary = load_json(Path(run["summary_json_path"]))
143
+ aggregate_df = pd.DataFrame(summary["aggregate_rows"]).set_index("method")
144
+ bootstrap_df = pd.DataFrame(summary["bootstrap_rows"])
145
+ for _, boot in bootstrap_df.iterrows():
146
+ method = str(boot["method"])
147
+ aggregate = aggregate_df.loc[method]
148
+ rows.append(
149
+ {
150
+ "track": run["track"],
151
+ "scope": run["scope"],
152
+ "gap": int(run["gap"]),
153
+ "archive_scope": run["archive_scope"],
154
+ "method": method,
155
+ "display_name": DISPLAY_NAME.get(method, method),
156
+ "bootstrap_unit": str(boot["bootstrap_unit"]),
157
+ "top1": float(aggregate["mean_top1_hit_rate"]),
158
+ "top1_ci_low": float(boot["top1_hit_rate_ci_low"]),
159
+ "top1_ci_high": float(boot["top1_hit_rate_ci_high"]),
160
+ "mrr": float(aggregate["mean_mrr"]),
161
+ "mrr_ci_low": float(boot["mrr_ci_low"]),
162
+ "mrr_ci_high": float(boot["mrr_ci_high"]),
163
+ "top5": float(aggregate["mean_top5_hit_rate"]),
164
+ "top5_ci_low": float(boot["top5_hit_rate_ci_low"]),
165
+ "top5_ci_high": float(boot["top5_hit_rate_ci_high"]),
166
+ "mean_candidate_size": float(aggregate["mean_candidate_size"]),
167
+ "mean_chance_top1": float(aggregate["mean_chance_top1"]),
168
+ "summary_json": str(run["summary_json"]),
169
+ }
170
+ )
171
+ return pd.DataFrame(rows).sort_values(["track", "scope", "gap", "bootstrap_unit", "method"]).reset_index(drop=True)
172
+
173
+
174
+ def date_row(df: pd.DataFrame, track: str, method: str, scope: str, gap: int) -> pd.Series:
175
+ rows = df[
176
+ (df["track"] == track)
177
+ & (df["method"] == method)
178
+ & (df["scope"] == scope)
179
+ & (df["gap"] == gap)
180
+ & (df["bootstrap_unit"] == "date")
181
+ ]
182
+ if rows.empty:
183
+ raise KeyError(f"Missing row: track={track}, method={method}, scope={scope}, gap={gap}")
184
+ return rows.iloc[0]
185
+
186
+
187
+ def ci_text(row: pd.Series, metric: str) -> str:
188
+ return f"{float(row[metric]):.4f} [{float(row[f'{metric}_ci_low']):.4f}, {float(row[f'{metric}_ci_high']):.4f}]"
189
+
190
+
191
+ def build_table3_recomputed(overview: pd.DataFrame) -> pd.DataFrame:
192
+ rows = []
193
+ for method in PUBLIC_METHODS:
194
+ global_row = date_row(overview, "default", method, "global", 1)
195
+ same_row = date_row(overview, "default", method, "same-archive", 1)
196
+ rows.append(
197
+ {
198
+ "method": method,
199
+ "display_name": DISPLAY_NAME.get(method, method),
200
+ "global_top1": round(float(global_row["top1"]), 4),
201
+ "global_mrr": round(float(global_row["mrr"]), 4),
202
+ "global_top5": round(float(global_row["top5"]), 4),
203
+ "same_archive_top1": round(float(same_row["top1"]), 4),
204
+ "same_archive_mrr": round(float(same_row["mrr"]), 4),
205
+ "same_archive_top5": round(float(same_row["top5"]), 4),
206
+ "global_mrr_ci": ci_text(global_row, "mrr"),
207
+ "same_archive_mrr_ci": ci_text(same_row, "mrr"),
208
+ }
209
+ )
210
+ return pd.DataFrame(rows)
211
+
212
+
213
+ def build_dual_track_recomputed(root: Path, overview: pd.DataFrame) -> pd.DataFrame:
214
+ rows = []
215
+ for track in ["default", "strict_clean"]:
216
+ feature_df = pd.read_csv(root / track_feature_table(track), usecols=["date"])
217
+ for scope_label, archive_scope in [("global", "global"), ("same-archive", "same_archive_only")]:
218
+ row = date_row(overview, track, "continuous", scope_label, 1)
219
+ rows.append(
220
+ {
221
+ "track": f"{track}__{archive_scope}",
222
+ "subset": track,
223
+ "archive_scope": archive_scope,
224
+ "rows": int(feature_df.shape[0]),
225
+ "date_count": int(feature_df["date"].astype(str).nunique()),
226
+ "top1": round(float(row["top1"]), 4),
227
+ "mrr": round(float(row["mrr"]), 4),
228
+ "top5": round(float(row["top5"]), 4),
229
+ "chance_top1": round(float(row["mean_chance_top1"]), 4),
230
+ }
231
+ )
232
+ return pd.DataFrame(rows)
233
+
234
+
235
+ def compare_table(
236
+ expected_path: Path,
237
+ actual_df: pd.DataFrame,
238
+ key_columns: list[str],
239
+ metric_columns: list[str],
240
+ tolerance: float,
241
+ ) -> list[dict[str, Any]]:
242
+ mismatches: list[dict[str, Any]] = []
243
+ if not expected_path.exists():
244
+ return [{"table": expected_path.name, "issue": "missing_expected_table"}]
245
+ expected_df = pd.read_csv(expected_path)
246
+ merged = expected_df.merge(actual_df, on=key_columns, how="outer", suffixes=("_expected", "_actual"), indicator=True)
247
+ for _, row in merged.iterrows():
248
+ key = {column: row[column] for column in key_columns}
249
+ if row["_merge"] != "both":
250
+ mismatches.append({"table": expected_path.name, "key": key, "issue": str(row["_merge"])})
251
+ continue
252
+ for column in metric_columns:
253
+ expected = float(row[f"{column}_expected"])
254
+ actual = float(row[f"{column}_actual"])
255
+ if abs(expected - actual) > tolerance:
256
+ mismatches.append(
257
+ {
258
+ "table": expected_path.name,
259
+ "key": key,
260
+ "metric": column,
261
+ "expected": expected,
262
+ "actual": actual,
263
+ "abs_delta": abs(expected - actual),
264
+ }
265
+ )
266
+ return mismatches
267
+
268
+
269
+ def write_markdown(path: Path, check: dict[str, Any]) -> None:
270
+ lines = [
271
+ "# CB-Telemetry Release Evaluation Check",
272
+ "",
273
+ f"- status: `{check['status']}`",
274
+ f"- bootstrap_samples: `{check['bootstrap_samples']}`",
275
+ f"- overview_rows: `{check['overview_rows']}`",
276
+ f"- mismatches: `{len(check['mismatches'])}`",
277
+ "",
278
+ "## Mismatches",
279
+ "",
280
+ ]
281
+ if check["mismatches"]:
282
+ for item in check["mismatches"]:
283
+ lines.append(f"- `{item}`")
284
+ else:
285
+ lines.append("- none")
286
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
287
+
288
+
289
+ def main() -> None:
290
+ args = parse_args()
291
+ root = Path(args.root).expanduser().resolve()
292
+ output_dir = resolve(root, args.output_dir)
293
+ output_dir.mkdir(parents=True, exist_ok=True)
294
+
295
+ run_rows = run_retrieval_suite(
296
+ root=root,
297
+ output_dir=output_dir,
298
+ bootstrap_samples=int(args.bootstrap_samples),
299
+ bootstrap_seed=int(args.bootstrap_seed),
300
+ random_seed=int(args.random_seed),
301
+ include_gap2=bool(args.include_gap2),
302
+ )
303
+ overview = build_overview(run_rows)
304
+ overview_path = output_dir / "release_retrieval_overview.csv"
305
+ overview.to_csv(overview_path, index=False)
306
+
307
+ table3 = build_table3_recomputed(overview)
308
+ table3_path = output_dir / "table_3_retrieval_baselines_and_controls_recomputed.csv"
309
+ table3.to_csv(table3_path, index=False)
310
+
311
+ dual = build_dual_track_recomputed(root, overview)
312
+ dual_path = output_dir / "table_3_dual_track_retrieval_recomputed.csv"
313
+ dual.to_csv(dual_path, index=False)
314
+
315
+ mismatches: list[dict[str, Any]] = []
316
+ mismatches.extend(
317
+ compare_table(
318
+ expected_path=root / "baselines" / "table_3_retrieval_baselines_and_controls.csv",
319
+ actual_df=table3,
320
+ key_columns=["method"],
321
+ metric_columns=[
322
+ "global_top1",
323
+ "global_mrr",
324
+ "global_top5",
325
+ "same_archive_top1",
326
+ "same_archive_mrr",
327
+ "same_archive_top5",
328
+ ],
329
+ tolerance=float(args.tolerance),
330
+ )
331
+ )
332
+ mismatches.extend(
333
+ compare_table(
334
+ expected_path=root / "baselines" / "table_3_dual_track_retrieval.csv",
335
+ actual_df=dual,
336
+ key_columns=["track"],
337
+ metric_columns=["top1", "mrr", "top5", "chance_top1"],
338
+ tolerance=float(args.tolerance),
339
+ )
340
+ )
341
+
342
+ check = {
343
+ "status": "pass" if not mismatches else "fail",
344
+ "root": root.name,
345
+ "output_dir": release_path(root, output_dir),
346
+ "bootstrap_samples": int(args.bootstrap_samples),
347
+ "include_gap2": bool(args.include_gap2),
348
+ "overview_rows": int(overview.shape[0]),
349
+ "files": {
350
+ "overview": release_path(root, overview_path),
351
+ "table3_recomputed": release_path(root, table3_path),
352
+ "dual_track_recomputed": release_path(root, dual_path),
353
+ },
354
+ "mismatches": mismatches,
355
+ }
356
+ (output_dir / "release_evaluation_check.json").write_text(
357
+ json.dumps(check, ensure_ascii=False, indent=2) + "\n",
358
+ encoding="utf-8",
359
+ )
360
+ write_markdown(output_dir / "release_evaluation_check.md", check)
361
+ print(json.dumps(check, ensure_ascii=False, indent=2))
362
+ raise SystemExit(0 if check["status"] == "pass" else 1)
363
+
364
+
365
+ if __name__ == "__main__":
366
+ main()
scripts/run_retrieval_eval.py ADDED
@@ -0,0 +1,629 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import json
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+ import numpy as np
10
+ import pandas as pd
11
+ from sklearn.metrics import pairwise_distances
12
+ from sklearn.preprocessing import StandardScaler
13
+
14
+
15
+ def parse_args() -> argparse.Namespace:
16
+ parser = argparse.ArgumentParser(
17
+ description="Run the CB-Telemetry time-matched retrieval protocol on released feature tables."
18
+ )
19
+ parser.add_argument("--root", default=".", help="CB-Telemetry dataset root.")
20
+ parser.add_argument("--feature-table", required=True, help="Anchor feature table used to define rows and slots.")
21
+ parser.add_argument("--output-dir", required=True, help="Directory for retrieval outputs.")
22
+ parser.add_argument("--max-slot-gap", type=int, default=1, help="Maximum neighboring-slot gap.")
23
+ parser.add_argument("--min-dates-per-pair", type=int, default=12, help="Minimum dates required per slot pair.")
24
+ parser.add_argument("--bootstrap-samples", type=int, default=2000, help="Bootstrap resamples for intervals.")
25
+ parser.add_argument("--bootstrap-seed", type=int, default=42, help="Bootstrap random seed.")
26
+ parser.add_argument("--random-seed", type=int, default=42, help="Random seed for the permuted-control baseline.")
27
+ parser.add_argument(
28
+ "--archive-scope",
29
+ choices=["global", "same_archive_only"],
30
+ default="global",
31
+ help="Candidate pool: all target rows, or rows from the same archive only.",
32
+ )
33
+ parser.add_argument(
34
+ "--representation",
35
+ action="append",
36
+ default=[],
37
+ help="Repeat as name=feature_table_path. Paths are resolved relative to --root unless absolute.",
38
+ )
39
+ parser.add_argument(
40
+ "--include-metadata-controls",
41
+ action="store_true",
42
+ help="Add metadata_basic, metadata_calendar, and random_permuted_continuous controls.",
43
+ )
44
+ return parser.parse_args()
45
+
46
+
47
+ def resolve_path(root: Path, raw_path: str) -> Path:
48
+ path = Path(raw_path).expanduser()
49
+ if not path.is_absolute():
50
+ path = (root / path).resolve()
51
+ return path
52
+
53
+
54
+ def release_path(root: Path, path: Path) -> str:
55
+ try:
56
+ return path.resolve().relative_to(root).as_posix()
57
+ except ValueError:
58
+ return path.as_posix()
59
+
60
+
61
+ def build_key(df: pd.DataFrame) -> pd.Series:
62
+ return (
63
+ df["archive"].astype(str).str.strip()
64
+ + "||"
65
+ + df["date"].astype(str).str.strip()
66
+ + "||"
67
+ + df["filename"].astype(str).str.strip()
68
+ )
69
+
70
+
71
+ def add_slot_metadata(df: pd.DataFrame) -> pd.DataFrame:
72
+ result = df.copy()
73
+ result["timestamp_dt"] = pd.to_datetime(result["timestamp"], errors="raise")
74
+ result["date"] = result["date"].astype(str)
75
+ result["archive"] = result["archive"].astype(str)
76
+ result["filename"] = result["filename"].astype(str)
77
+ result["key"] = build_key(result)
78
+ result["dawn_slot_id"] = 0
79
+ result["slot_count_on_date"] = 0
80
+ result["slot_hour_signature"] = ""
81
+ for date_str, group in result.groupby("date", sort=True):
82
+ ordered = group.sort_values(["timestamp_dt", "filename"]).copy()
83
+ slot_ids = np.arange(1, len(ordered) + 1, dtype=np.int32)
84
+ result.loc[ordered.index, "dawn_slot_id"] = slot_ids
85
+ result.loc[ordered.index, "slot_count_on_date"] = int(len(ordered))
86
+ signature = "-".join(str(int(item)) for item in ordered["hour"].tolist())
87
+ result.loc[ordered.index, "slot_hour_signature"] = signature
88
+ result["dawn_slot_id"] = result["dawn_slot_id"].astype(int)
89
+ result["slot_count_on_date"] = result["slot_count_on_date"].astype(int)
90
+ return result
91
+
92
+
93
+ def feature_columns(df: pd.DataFrame) -> list[str]:
94
+ columns = [col for col in df.columns if col.startswith("f_")]
95
+ if not columns:
96
+ raise RuntimeError("No f_* feature columns were found.")
97
+ return columns
98
+
99
+
100
+ def standardize(matrix: np.ndarray) -> np.ndarray:
101
+ return StandardScaler().fit_transform(matrix.astype(np.float32, copy=False)).astype(np.float32)
102
+
103
+
104
+ def load_representation_matrix(root: Path, path_text: str, anchor_df: pd.DataFrame) -> np.ndarray:
105
+ path = resolve_path(root, path_text)
106
+ df = pd.read_csv(path, low_memory=False).copy()
107
+ df["date"] = df["date"].astype(str)
108
+ df["archive"] = df["archive"].astype(str)
109
+ df["filename"] = df["filename"].astype(str)
110
+ df["key"] = build_key(df)
111
+ columns = feature_columns(df)
112
+ indexed = df.set_index("key")
113
+ keys = anchor_df["key"].tolist()
114
+ missing = [key for key in keys if key not in indexed.index]
115
+ if missing:
116
+ raise RuntimeError(f"{path} is missing {len(missing)} anchor rows.")
117
+ matrix = indexed.loc[keys, columns].to_numpy(dtype=np.float32)
118
+ return standardize(matrix)
119
+
120
+
121
+ def parse_representations(items: list[str]) -> list[tuple[str, str]]:
122
+ if not items:
123
+ raise ValueError("At least one --representation name=path is required.")
124
+ result: list[tuple[str, str]] = []
125
+ for item in items:
126
+ if "=" not in item:
127
+ raise ValueError(f"Invalid representation argument: {item}")
128
+ name, raw_path = item.split("=", 1)
129
+ result.append((name.strip(), raw_path.strip()))
130
+ return result
131
+
132
+
133
+ def build_metadata_matrix(anchor_df: pd.DataFrame, include_calendar: bool) -> np.ndarray:
134
+ archive_dummies = pd.get_dummies(anchor_df["archive"].astype(str), prefix="archive", dtype=np.float32)
135
+ slot_dummies = pd.get_dummies(anchor_df["dawn_slot_id"].astype(int), prefix="slot", dtype=np.float32)
136
+ blocks = [
137
+ anchor_df["hour"].astype(np.float32).to_numpy()[:, None],
138
+ archive_dummies.to_numpy(dtype=np.float32),
139
+ slot_dummies.to_numpy(dtype=np.float32),
140
+ ]
141
+ if include_calendar:
142
+ date_dt = pd.to_datetime(anchor_df["date"].astype(str), format="%Y%m%d", errors="raise")
143
+ month_angle = 2.0 * np.pi * (date_dt.dt.month.to_numpy(dtype=np.float32) - 1.0) / 12.0
144
+ year_offset = date_dt.dt.year.to_numpy(dtype=np.float32) - float(date_dt.dt.year.min())
145
+ blocks.extend(
146
+ [
147
+ np.sin(month_angle).astype(np.float32)[:, None],
148
+ np.cos(month_angle).astype(np.float32)[:, None],
149
+ year_offset.astype(np.float32)[:, None],
150
+ ]
151
+ )
152
+ return standardize(np.column_stack(blocks).astype(np.float32))
153
+
154
+
155
+ def cosine_rank_indices(query_matrix: np.ndarray, target_matrix: np.ndarray) -> np.ndarray:
156
+ distances = pairwise_distances(query_matrix, target_matrix, metric="cosine")
157
+ return np.argsort(distances, axis=1)
158
+
159
+
160
+ def reciprocal_rank(rank_index_zero_based: int) -> float:
161
+ return 1.0 / float(rank_index_zero_based + 1)
162
+
163
+
164
+ def summarize_query_rows(query_df: pd.DataFrame) -> dict[str, float]:
165
+ rank_positions = query_df["rank_position"].to_numpy(dtype=np.float32)
166
+ return {
167
+ "top1_hit_rate": float(query_df["top1_hit"].mean()),
168
+ "top5_hit_rate": float(query_df["top5_hit"].mean()),
169
+ "mrr": float(query_df["reciprocal_rank"].mean()),
170
+ "median_rank": float(np.median(rank_positions)),
171
+ "mean_rank": float(np.mean(rank_positions)),
172
+ }
173
+
174
+
175
+ def evaluate_pair_subset(
176
+ matrix: np.ndarray,
177
+ pair_df: pd.DataFrame,
178
+ query_slot: int,
179
+ target_slot: int,
180
+ archive_label: str,
181
+ ) -> dict[str, Any]:
182
+ eligible_dates = pair_df.groupby("date")["dawn_slot_id"].nunique().reset_index(name="slot_count")
183
+ eligible_dates = eligible_dates[eligible_dates["slot_count"] == 2]["date"].astype(str).tolist()
184
+ pair_df = pair_df[pair_df["date"].isin(eligible_dates)].copy()
185
+ query_df = pair_df[pair_df["dawn_slot_id"] == query_slot].copy().sort_values("date").reset_index(drop=True)
186
+ target_df = pair_df[pair_df["dawn_slot_id"] == target_slot].copy().sort_values("date").reset_index(drop=True)
187
+
188
+ if query_df.empty or target_df.empty:
189
+ raise RuntimeError(f"slot_pair {query_slot}->{target_slot} has no valid rows.")
190
+ if query_df["date"].tolist() != target_df["date"].tolist():
191
+ raise RuntimeError(f"slot_pair {query_slot}->{target_slot} query and target dates are not aligned.")
192
+
193
+ query_matrix = matrix[query_df["anchor_row_index"].to_numpy()]
194
+ target_matrix = matrix[target_df["anchor_row_index"].to_numpy()]
195
+ ranks = cosine_rank_indices(query_matrix, target_matrix)
196
+
197
+ positive_dates = query_df["date"].tolist()
198
+ target_dates = target_df["date"].tolist()
199
+ query_rows: list[dict[str, Any]] = []
200
+ for row_idx, expected_date in enumerate(positive_dates):
201
+ ranked_dates = [target_dates[item] for item in ranks[row_idx].tolist()]
202
+ positive_rank = ranked_dates.index(expected_date)
203
+ query_rows.append(
204
+ {
205
+ "date": str(expected_date),
206
+ "query_slot": int(query_slot),
207
+ "target_slot": int(target_slot),
208
+ "archive_scope_label": archive_label,
209
+ "candidate_size_per_query": int(len(target_df)),
210
+ "chance_top1": 1.0 / float(len(target_df)),
211
+ "rank_position": int(positive_rank + 1),
212
+ "top1_hit": 1.0 if positive_rank == 0 else 0.0,
213
+ "top5_hit": 1.0 if positive_rank < min(5, len(ranked_dates)) else 0.0,
214
+ "reciprocal_rank": reciprocal_rank(positive_rank),
215
+ }
216
+ )
217
+
218
+ query_result_df = pd.DataFrame(query_rows)
219
+ metrics = summarize_query_rows(query_result_df)
220
+ return {
221
+ "query_slot": int(query_slot),
222
+ "target_slot": int(target_slot),
223
+ "archive_scope_label": archive_label,
224
+ "query_rows": int(len(query_df)),
225
+ "candidate_rows": int(len(target_df)),
226
+ "candidate_size_per_query": int(len(target_df)),
227
+ "chance_top1": 1.0 / float(len(target_df)),
228
+ "top1_hit_rate": metrics["top1_hit_rate"],
229
+ "top5_hit_rate": metrics["top5_hit_rate"],
230
+ "mrr": metrics["mrr"],
231
+ "median_rank": metrics["median_rank"],
232
+ "mean_rank": metrics["mean_rank"],
233
+ "date_examples": positive_dates[:5],
234
+ "query_details": query_rows,
235
+ }
236
+
237
+
238
+ def evaluate_slot_pair(
239
+ matrix: np.ndarray,
240
+ anchor_df: pd.DataFrame,
241
+ query_slot: int,
242
+ target_slot: int,
243
+ archive_scope: str,
244
+ min_dates_per_pair: int,
245
+ ) -> list[dict[str, Any]]:
246
+ pair_df = anchor_df[anchor_df["dawn_slot_id"].isin([query_slot, target_slot])].copy()
247
+ if archive_scope == "global":
248
+ return [
249
+ evaluate_pair_subset(
250
+ matrix,
251
+ pair_df=pair_df,
252
+ query_slot=query_slot,
253
+ target_slot=target_slot,
254
+ archive_label="all",
255
+ )
256
+ ]
257
+
258
+ rows: list[dict[str, Any]] = []
259
+ for archive_name, archive_df in pair_df.groupby("archive", sort=True):
260
+ if archive_df["dawn_slot_id"].nunique() < 2:
261
+ continue
262
+ eligible_dates = archive_df.groupby("date")["dawn_slot_id"].nunique().reset_index(name="slot_count")
263
+ eligible_dates = eligible_dates[eligible_dates["slot_count"] == 2]
264
+ if int(len(eligible_dates)) < min_dates_per_pair:
265
+ continue
266
+ rows.append(
267
+ evaluate_pair_subset(
268
+ matrix,
269
+ pair_df=archive_df.copy(),
270
+ query_slot=query_slot,
271
+ target_slot=target_slot,
272
+ archive_label=str(archive_name),
273
+ )
274
+ )
275
+ return rows
276
+
277
+
278
+ def build_slot_pairs(
279
+ anchor_df: pd.DataFrame,
280
+ max_slot_gap: int,
281
+ min_dates_per_pair: int,
282
+ archive_scope: str,
283
+ ) -> list[tuple[int, int]]:
284
+ max_slot_id = int(anchor_df["dawn_slot_id"].max())
285
+ pairs: list[tuple[int, int]] = []
286
+ for query_slot in range(1, max_slot_id + 1):
287
+ for target_slot in range(1, max_slot_id + 1):
288
+ if query_slot == target_slot:
289
+ continue
290
+ if abs(query_slot - target_slot) > max_slot_gap:
291
+ continue
292
+ pair_df = anchor_df[anchor_df["dawn_slot_id"].isin([query_slot, target_slot])].copy()
293
+ if archive_scope == "global":
294
+ eligible_dates = pair_df.groupby("date")["dawn_slot_id"].nunique().reset_index(name="slot_count")
295
+ eligible_dates = eligible_dates[eligible_dates["slot_count"] == 2]
296
+ if int(len(eligible_dates)) >= min_dates_per_pair:
297
+ pairs.append((query_slot, target_slot))
298
+ continue
299
+
300
+ archive_has_valid_pair = False
301
+ for _, archive_df in pair_df.groupby("archive", sort=True):
302
+ if archive_df["dawn_slot_id"].nunique() < 2:
303
+ continue
304
+ eligible_dates = archive_df.groupby("date")["dawn_slot_id"].nunique().reset_index(name="slot_count")
305
+ eligible_dates = eligible_dates[eligible_dates["slot_count"] == 2]
306
+ if int(len(eligible_dates)) >= min_dates_per_pair:
307
+ archive_has_valid_pair = True
308
+ break
309
+ if archive_has_valid_pair:
310
+ pairs.append((query_slot, target_slot))
311
+ if not pairs:
312
+ raise RuntimeError("No valid slot pairs satisfy min_dates_per_pair.")
313
+ return sorted(pairs)
314
+
315
+
316
+ def aggregate_pair_rows(method_name: str, pair_df: pd.DataFrame) -> dict[str, float | str]:
317
+ return {
318
+ "method": method_name,
319
+ "mean_top1_hit_rate": float(pair_df["top1_hit_rate"].mean()),
320
+ "mean_top5_hit_rate": float(pair_df["top5_hit_rate"].mean()),
321
+ "mean_mrr": float(pair_df["mrr"].mean()),
322
+ "mean_median_rank": float(pair_df["median_rank"].mean()),
323
+ "mean_candidate_size": float(pair_df["candidate_size_per_query"].mean()),
324
+ "mean_chance_top1": float(pair_df["chance_top1"].mean()),
325
+ }
326
+
327
+
328
+ def evaluate_representation(
329
+ method_name: str,
330
+ matrix: np.ndarray,
331
+ anchor_df: pd.DataFrame,
332
+ slot_pairs: list[tuple[int, int]],
333
+ archive_scope: str,
334
+ min_dates_per_pair: int,
335
+ ) -> dict[str, Any]:
336
+ pair_rows: list[dict[str, Any]] = []
337
+ query_rows: list[dict[str, Any]] = []
338
+ for query_slot, target_slot in slot_pairs:
339
+ rows = evaluate_slot_pair(
340
+ matrix,
341
+ anchor_df,
342
+ query_slot=query_slot,
343
+ target_slot=target_slot,
344
+ archive_scope=archive_scope,
345
+ min_dates_per_pair=min_dates_per_pair,
346
+ )
347
+ for row in rows:
348
+ raw_query_details = row.pop("query_details")
349
+ row["method"] = method_name
350
+ pair_rows.append(row)
351
+ for query_detail in raw_query_details:
352
+ query_detail["method"] = method_name
353
+ query_rows.append(query_detail)
354
+ if not pair_rows:
355
+ raise RuntimeError(f"method={method_name} has no valid pair rows.")
356
+ aggregate = aggregate_pair_rows(method_name, pd.DataFrame(pair_rows))
357
+ return {"aggregate": aggregate, "pairs": pair_rows, "queries": query_rows}
358
+
359
+
360
+ def percentile_interval(samples: list[float]) -> tuple[float, float]:
361
+ values = np.asarray(samples, dtype=np.float64)
362
+ return float(np.percentile(values, 2.5)), float(np.percentile(values, 97.5))
363
+
364
+
365
+ def bootstrap_pair_level(
366
+ method_name: str,
367
+ pair_df: pd.DataFrame,
368
+ bootstrap_samples: int,
369
+ rng: np.random.Generator,
370
+ ) -> dict[str, Any]:
371
+ metric_names = ["top1_hit_rate", "mrr", "top5_hit_rate"]
372
+ point_estimates = {metric: float(pair_df[metric].mean()) for metric in metric_names}
373
+ boot_values = {metric: [] for metric in metric_names}
374
+ pair_count = len(pair_df)
375
+ for _ in range(bootstrap_samples):
376
+ sampled_indices = rng.integers(0, pair_count, size=pair_count)
377
+ sampled = pair_df.iloc[sampled_indices]
378
+ for metric in metric_names:
379
+ boot_values[metric].append(float(sampled[metric].mean()))
380
+
381
+ result: dict[str, Any] = {
382
+ "method": method_name,
383
+ "bootstrap_unit": "pair",
384
+ "bootstrap_samples": int(bootstrap_samples),
385
+ "group_count": int(pair_count),
386
+ }
387
+ for metric in metric_names:
388
+ ci_low, ci_high = percentile_interval(boot_values[metric])
389
+ result[f"{metric}_point_estimate"] = point_estimates[metric]
390
+ result[f"{metric}_ci_low"] = ci_low
391
+ result[f"{metric}_ci_high"] = ci_high
392
+ return result
393
+
394
+
395
+ def bootstrap_date_level(
396
+ method_name: str,
397
+ query_df: pd.DataFrame,
398
+ bootstrap_samples: int,
399
+ rng: np.random.Generator,
400
+ ) -> dict[str, Any]:
401
+ grouped_queries = {
402
+ group_key: group.copy().reset_index(drop=True)
403
+ for group_key, group in query_df.groupby(["query_slot", "target_slot", "archive_scope_label"], sort=True)
404
+ }
405
+ point_pair_rows: list[dict[str, float | str]] = []
406
+ for group_key, group in grouped_queries.items():
407
+ metrics = summarize_query_rows(group)
408
+ point_pair_rows.append(
409
+ {
410
+ "group_key": str(group_key),
411
+ "top1_hit_rate": metrics["top1_hit_rate"],
412
+ "mrr": metrics["mrr"],
413
+ "top5_hit_rate": metrics["top5_hit_rate"],
414
+ }
415
+ )
416
+ point_pair_df = pd.DataFrame(point_pair_rows)
417
+ point_estimates = {
418
+ "top1_hit_rate": float(point_pair_df["top1_hit_rate"].mean()),
419
+ "mrr": float(point_pair_df["mrr"].mean()),
420
+ "top5_hit_rate": float(point_pair_df["top5_hit_rate"].mean()),
421
+ }
422
+ boot_values = {"top1_hit_rate": [], "mrr": [], "top5_hit_rate": []}
423
+ for _ in range(bootstrap_samples):
424
+ sampled_pair_rows: list[dict[str, float | str]] = []
425
+ for group_key, group in grouped_queries.items():
426
+ sampled_indices = rng.integers(0, len(group), size=len(group))
427
+ sampled_group = group.iloc[sampled_indices].reset_index(drop=True)
428
+ metrics = summarize_query_rows(sampled_group)
429
+ sampled_pair_rows.append(
430
+ {
431
+ "group_key": str(group_key),
432
+ "top1_hit_rate": metrics["top1_hit_rate"],
433
+ "mrr": metrics["mrr"],
434
+ "top5_hit_rate": metrics["top5_hit_rate"],
435
+ }
436
+ )
437
+ sampled_pair_df = pd.DataFrame(sampled_pair_rows)
438
+ boot_values["top1_hit_rate"].append(float(sampled_pair_df["top1_hit_rate"].mean()))
439
+ boot_values["mrr"].append(float(sampled_pair_df["mrr"].mean()))
440
+ boot_values["top5_hit_rate"].append(float(sampled_pair_df["top5_hit_rate"].mean()))
441
+
442
+ result: dict[str, Any] = {
443
+ "method": method_name,
444
+ "bootstrap_unit": "date",
445
+ "bootstrap_samples": int(bootstrap_samples),
446
+ "group_count": int(len(grouped_queries)),
447
+ "query_row_count": int(len(query_df)),
448
+ }
449
+ for metric in ["top1_hit_rate", "mrr", "top5_hit_rate"]:
450
+ ci_low, ci_high = percentile_interval(boot_values[metric])
451
+ result[f"{metric}_point_estimate"] = point_estimates[metric]
452
+ result[f"{metric}_ci_low"] = ci_low
453
+ result[f"{metric}_ci_high"] = ci_high
454
+ return result
455
+
456
+
457
+ def bootstrap_rows(
458
+ method_name: str,
459
+ pair_df: pd.DataFrame,
460
+ query_df: pd.DataFrame,
461
+ bootstrap_samples: int,
462
+ bootstrap_seed: int,
463
+ ) -> list[dict[str, Any]]:
464
+ pair_rng = np.random.default_rng(bootstrap_seed)
465
+ date_rng = np.random.default_rng(bootstrap_seed + 1000)
466
+ return [
467
+ bootstrap_date_level(method_name, query_df, bootstrap_samples=bootstrap_samples, rng=date_rng),
468
+ bootstrap_pair_level(method_name, pair_df, bootstrap_samples=bootstrap_samples, rng=pair_rng),
469
+ ]
470
+
471
+
472
+ def write_markdown(output_path: Path, summary: dict[str, Any]) -> None:
473
+ lines = [
474
+ "# CB-Telemetry Time-Matched Retrieval",
475
+ "",
476
+ f"- feature_table: `{summary['feature_table']}`",
477
+ f"- max_slot_gap: `{summary['max_slot_gap']}`",
478
+ f"- min_dates_per_pair: `{summary['min_dates_per_pair']}`",
479
+ f"- archive_scope: `{summary['archive_scope']}`",
480
+ f"- bootstrap_samples: `{summary['bootstrap_samples']}`",
481
+ f"- slot_pairs: `{summary['slot_pairs']}`",
482
+ "",
483
+ "## Aggregate",
484
+ "",
485
+ "| method | top1 | chance_top1 | mrr | top5 | mean_candidate_size |",
486
+ "| --- | --- | --- | --- | --- | --- |",
487
+ ]
488
+ for row in summary["aggregate_rows"]:
489
+ lines.append(
490
+ f"| {row['method']} | {row['mean_top1_hit_rate']:.4f} | {row['mean_chance_top1']:.4f} | "
491
+ f"{row['mean_mrr']:.4f} | {row['mean_top5_hit_rate']:.4f} | {row['mean_candidate_size']:.1f} |"
492
+ )
493
+ lines.extend(["", "## Bootstrap 95% CI", "", "| method | unit | top1 | mrr | top5 |", "| --- | --- | --- | --- | --- |"])
494
+ for row in summary["bootstrap_rows"]:
495
+ lines.append(
496
+ f"| {row['method']} | {row['bootstrap_unit']} | "
497
+ f"{row['top1_hit_rate_point_estimate']:.4f} [{row['top1_hit_rate_ci_low']:.4f}, {row['top1_hit_rate_ci_high']:.4f}] | "
498
+ f"{row['mrr_point_estimate']:.4f} [{row['mrr_ci_low']:.4f}, {row['mrr_ci_high']:.4f}] | "
499
+ f"{row['top5_hit_rate_point_estimate']:.4f} [{row['top5_hit_rate_ci_low']:.4f}, {row['top5_hit_rate_ci_high']:.4f}] |"
500
+ )
501
+ output_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
502
+
503
+
504
+ def main() -> None:
505
+ args = parse_args()
506
+ root = Path(args.root).expanduser().resolve()
507
+ output_dir = resolve_path(root, args.output_dir)
508
+ output_dir.mkdir(parents=True, exist_ok=True)
509
+
510
+ feature_table_path = resolve_path(root, args.feature_table)
511
+ anchor_df = add_slot_metadata(pd.read_csv(feature_table_path, low_memory=False))
512
+ anchor_df = anchor_df.sort_values(["date", "timestamp_dt", "filename"]).reset_index(drop=True)
513
+ anchor_df["anchor_row_index"] = np.arange(len(anchor_df), dtype=np.int32)
514
+ slot_pairs = build_slot_pairs(
515
+ anchor_df,
516
+ max_slot_gap=args.max_slot_gap,
517
+ min_dates_per_pair=args.min_dates_per_pair,
518
+ archive_scope=args.archive_scope,
519
+ )
520
+
521
+ representation_matrices: list[tuple[str, np.ndarray, str]] = []
522
+ for method_name, raw_path in parse_representations(args.representation):
523
+ representation_matrices.append((method_name, load_representation_matrix(root, raw_path, anchor_df), raw_path))
524
+
525
+ if args.include_metadata_controls:
526
+ representation_matrices.append(("metadata_basic", build_metadata_matrix(anchor_df, include_calendar=False), "generated"))
527
+ representation_matrices.append(("metadata_calendar", build_metadata_matrix(anchor_df, include_calendar=True), "generated"))
528
+ continuous_columns = feature_columns(anchor_df)
529
+ continuous_matrix = anchor_df[continuous_columns].to_numpy(dtype=np.float32)
530
+ rng = np.random.default_rng(args.random_seed)
531
+ permuted = continuous_matrix[rng.permutation(len(anchor_df))]
532
+ representation_matrices.append(("random_permuted_continuous", standardize(permuted), "generated"))
533
+
534
+ aggregate_rows: list[dict[str, Any]] = []
535
+ pair_rows: list[dict[str, Any]] = []
536
+ query_rows: list[dict[str, Any]] = []
537
+ all_bootstrap_rows: list[dict[str, Any]] = []
538
+ detailed_results: dict[str, Any] = {}
539
+
540
+ for method_name, matrix, source_path in representation_matrices:
541
+ result = evaluate_representation(
542
+ method_name=method_name,
543
+ matrix=matrix,
544
+ anchor_df=anchor_df,
545
+ slot_pairs=slot_pairs,
546
+ archive_scope=args.archive_scope,
547
+ min_dates_per_pair=args.min_dates_per_pair,
548
+ )
549
+ aggregate_rows.append(result["aggregate"])
550
+ pair_rows.extend(result["pairs"])
551
+ query_rows.extend(result["queries"])
552
+ method_pair_df = pd.DataFrame(result["pairs"])
553
+ method_query_df = pd.DataFrame(result["queries"])
554
+ method_bootstrap_rows = bootstrap_rows(
555
+ method_name=method_name,
556
+ pair_df=method_pair_df,
557
+ query_df=method_query_df,
558
+ bootstrap_samples=args.bootstrap_samples,
559
+ bootstrap_seed=args.bootstrap_seed,
560
+ )
561
+ all_bootstrap_rows.extend(method_bootstrap_rows)
562
+ detailed_results[method_name] = {
563
+ "feature_table": source_path,
564
+ "aggregate": result["aggregate"],
565
+ "bootstrap": method_bootstrap_rows,
566
+ }
567
+
568
+ aggregate_df = pd.DataFrame(aggregate_rows).sort_values(
569
+ ["mean_top1_hit_rate", "mean_mrr", "mean_top5_hit_rate"],
570
+ ascending=False,
571
+ ).reset_index(drop=True)
572
+ pair_df = pd.DataFrame(pair_rows).sort_values(["method", "query_slot", "target_slot"]).reset_index(drop=True)
573
+ query_df = pd.DataFrame(query_rows).sort_values(
574
+ ["method", "query_slot", "target_slot", "archive_scope_label", "date"]
575
+ ).reset_index(drop=True)
576
+ bootstrap_df = pd.DataFrame(all_bootstrap_rows).sort_values(
577
+ ["bootstrap_unit", "top1_hit_rate_point_estimate", "mrr_point_estimate", "top5_hit_rate_point_estimate"],
578
+ ascending=[True, False, False, False],
579
+ ).reset_index(drop=True)
580
+
581
+ aggregate_df.to_csv(output_dir / "aggregate_summary.csv", index=False)
582
+ pair_df.to_csv(output_dir / "pair_summary.csv", index=False)
583
+ query_df.to_csv(output_dir / "query_summary.csv", index=False)
584
+ bootstrap_df.to_csv(output_dir / "bootstrap_summary.csv", index=False)
585
+
586
+ summary: dict[str, Any] = {
587
+ "feature_table": release_path(root, feature_table_path),
588
+ "output_dir": release_path(root, output_dir),
589
+ "files": {
590
+ "aggregate_summary_csv": release_path(root, output_dir / "aggregate_summary.csv"),
591
+ "pair_summary_csv": release_path(root, output_dir / "pair_summary.csv"),
592
+ "query_summary_csv": release_path(root, output_dir / "query_summary.csv"),
593
+ "bootstrap_summary_csv": release_path(root, output_dir / "bootstrap_summary.csv"),
594
+ },
595
+ "max_slot_gap": int(args.max_slot_gap),
596
+ "min_dates_per_pair": int(args.min_dates_per_pair),
597
+ "archive_scope": args.archive_scope,
598
+ "bootstrap_samples": int(args.bootstrap_samples),
599
+ "bootstrap_seed": int(args.bootstrap_seed),
600
+ "slot_pairs": [f"{src}->{dst}" for src, dst in slot_pairs],
601
+ "rows": int(len(anchor_df)),
602
+ "date_count": int(anchor_df["date"].nunique()),
603
+ "slot_count_distribution": {
604
+ str(key): int(value)
605
+ for key, value in anchor_df.groupby("date")["dawn_slot_id"].max().value_counts().sort_index().to_dict().items()
606
+ },
607
+ "aggregate_rows": aggregate_df.to_dict(orient="records"),
608
+ "bootstrap_rows": bootstrap_df.to_dict(orient="records"),
609
+ "pair_rows": pair_df.to_dict(orient="records"),
610
+ "detailed_results": detailed_results,
611
+ }
612
+ (output_dir / "summary.json").write_text(json.dumps(summary, ensure_ascii=False, indent=2), encoding="utf-8")
613
+ write_markdown(output_dir / "summary.md", summary)
614
+ print(
615
+ json.dumps(
616
+ {
617
+ "output_dir": summary["output_dir"],
618
+ "archive_scope": summary["archive_scope"],
619
+ "max_slot_gap": summary["max_slot_gap"],
620
+ "aggregate_rows": summary["aggregate_rows"],
621
+ },
622
+ ensure_ascii=False,
623
+ indent=2,
624
+ )
625
+ )
626
+
627
+
628
+ if __name__ == "__main__":
629
+ main()
scripts/validate_cb_telemetry.py CHANGED
@@ -29,10 +29,10 @@ LOCAL_PATH_PATTERNS = [
29
  re.compile(r"\\Users\\"),
30
  ]
31
 
32
- PLACEHOLDER_PATTERNS = [
33
- re.compile(r"\bTBD\b", re.IGNORECASE),
34
- re.compile(r"\bTODO\b", re.IGNORECASE),
35
- re.compile(r"placeholder", re.IGNORECASE),
36
  ]
37
 
38
  JUNK_FILE_NAMES = {".DS_Store", "Thumbs.db"}
@@ -111,9 +111,9 @@ def scan_text(root: Path, errors: list[dict[str, str]], warnings: list[dict[str,
111
  for pattern in LOCAL_PATH_PATTERNS:
112
  if pattern.search(text):
113
  add_issue(errors, "local_path_leak", f"Local path pattern found in {rel}: {pattern.pattern}")
114
- for pattern in PLACEHOLDER_PATTERNS:
115
  if pattern.search(text):
116
- add_issue(warnings, "placeholder_text", f"Placeholder-like text found in {rel}: {pattern.pattern}")
117
 
118
 
119
  def validate_ids(root: Path, errors: list[dict[str, str]], warnings: list[dict[str, str]]) -> dict[str, int]:
@@ -341,10 +341,19 @@ def main() -> None:
341
  "manifests/splits.csv",
342
  "features/feature_table_default.csv.gz",
343
  "features/feature_table_strict_clean.csv.gz",
 
 
 
 
 
 
344
  "baselines/table_2_representation_structure.csv",
345
  "baselines/table_3_retrieval_baselines_and_controls.csv",
 
346
  "scripts/download_audio_recordings.py",
347
  "scripts/run_smoke_eval.py",
 
 
348
  ],
349
  errors,
350
  )
 
29
  re.compile(r"\\Users\\"),
30
  ]
31
 
32
+ DRAFT_TEXT_PATTERNS = [
33
+ re.compile(r"\b" + "T" + "BD" + r"\b", re.IGNORECASE),
34
+ re.compile(r"\b" + "TO" + "DO" + r"\b", re.IGNORECASE),
35
+ re.compile("place" + "holder", re.IGNORECASE),
36
  ]
37
 
38
  JUNK_FILE_NAMES = {".DS_Store", "Thumbs.db"}
 
111
  for pattern in LOCAL_PATH_PATTERNS:
112
  if pattern.search(text):
113
  add_issue(errors, "local_path_leak", f"Local path pattern found in {rel}: {pattern.pattern}")
114
+ for pattern in DRAFT_TEXT_PATTERNS:
115
  if pattern.search(text):
116
+ add_issue(warnings, "draft_text", f"Draft-like marker found in {rel}: {pattern.pattern}")
117
 
118
 
119
  def validate_ids(root: Path, errors: list[dict[str, str]], warnings: list[dict[str, str]]) -> dict[str, int]:
 
341
  "manifests/splits.csv",
342
  "features/feature_table_default.csv.gz",
343
  "features/feature_table_strict_clean.csv.gz",
344
+ "features/bottlenecks/default/standard_rvq_8bit_feature_table.csv.gz",
345
+ "features/bottlenecks/default/pq_8bit_feature_table.csv.gz",
346
+ "features/bottlenecks/default/opq_8bit_feature_table.csv.gz",
347
+ "features/bottlenecks/strict_clean/standard_rvq_8bit_feature_table.csv.gz",
348
+ "features/bottlenecks/strict_clean/pq_8bit_feature_table.csv.gz",
349
+ "features/bottlenecks/strict_clean/opq_8bit_feature_table.csv.gz",
350
  "baselines/table_2_representation_structure.csv",
351
  "baselines/table_3_retrieval_baselines_and_controls.csv",
352
+ "requirements.txt",
353
  "scripts/download_audio_recordings.py",
354
  "scripts/run_smoke_eval.py",
355
+ "scripts/run_retrieval_eval.py",
356
+ "scripts/run_release_evaluation.py",
357
  ],
358
  errors,
359
  )