Commit 275ff4e
committed
Fix alignment on Windows; auto-skip low-quality transcripts
Alignment Windows fixes:
- config.json read now uses encoding='utf-8' explicitly (avoids cp1252 crash)
- show_progress_bar=False in encode() avoids tqdm pipe-mode issues on Windows
- captions_dir.exists() guard before Path.glob() (Python 3.12 compat)
- get_embedder() wraps model load in try/except with helpful error message
- process_course() prints course/captions dir at startup for easier diagnosis
- All key print() calls have flush=True
Auto-detect wrong recordings:
- After transcription, compute words-per-minute; if < 50 words total or
< 10 wpm → write quality='low' into caption JSON
- process_course() reads quality flag and skips low-quality captions with
a clear [skip] message, preventing wasted embedding + alignment work
- Both local (faster-whisper) and API backends flag low-quality output1 parent 2fd2d52 commit 275ff4e
3 files changed
Lines changed: 65 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
355 | 368 | | |
356 | 369 | | |
357 | 370 | | |
358 | 371 | | |
359 | | - | |
360 | | - | |
361 | 372 | | |
362 | 373 | | |
363 | 374 | | |
| |||
452 | 463 | | |
453 | 464 | | |
454 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
455 | 480 | | |
456 | 481 | | |
457 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
396 | | - | |
397 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
398 | 404 | | |
399 | 405 | | |
400 | 406 | | |
401 | 407 | | |
402 | 408 | | |
403 | | - | |
| 409 | + | |
404 | 410 | | |
405 | 411 | | |
406 | 412 | | |
407 | | - | |
| 413 | + | |
408 | 414 | | |
409 | 415 | | |
410 | 416 | | |
| 417 | + | |
411 | 418 | | |
412 | 419 | | |
413 | 420 | | |
| |||
1106 | 1113 | | |
1107 | 1114 | | |
1108 | 1115 | | |
1109 | | - | |
1110 | | - | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
1111 | 1122 | | |
1112 | 1123 | | |
1113 | 1124 | | |
1114 | 1125 | | |
1115 | | - | |
| 1126 | + | |
| 1127 | + | |
1116 | 1128 | | |
1117 | 1129 | | |
1118 | | - | |
| 1130 | + | |
| 1131 | + | |
1119 | 1132 | | |
1120 | 1133 | | |
| 1134 | + | |
| 1135 | + | |
1121 | 1136 | | |
1122 | 1137 | | |
1123 | 1138 | | |
| |||
1128 | 1143 | | |
1129 | 1144 | | |
1130 | 1145 | | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1131 | 1156 | | |
1132 | 1157 | | |
1133 | 1158 | | |
| |||
0 commit comments