Repository navigation
音频管线:LLM 结论列 null 语义修复 + status 列落实行不丢弃约定 - #21
Merged
Merged
Conversation
added 3 commits
July 15, 2026 15:53
… tagging - Stop fill_null'ing LLM verdict columns: null now means "not judged", never disguised as "judged no". Compliance queries can distinguish unprocessed rows from negative verdicts. - Preserve every manifest row through analyze/ingest with a status column (ok / download_failed / decode_failed / duration_filtered / llm_failed / blob_download_failed), mirroring the image pipeline. - duration_udf returns null for undecodable bytes; ASR/prompt/embed UDFs skip non-ok rows via null propagation. - Audio ingest keeps null-blob rows (blob_download_failed) and casts all-null JSONL columns to canonical dtypes so a keyless batch cannot poison the Lance schema. - Add audio/llm.py provider adapter: Daft 0.7.15 leaks UDF options (on_error/concurrency) into OpenAI request kwargs, so every LLM call raised TypeError; previously invisible because fill_null masked the failures as negative verdicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
端到端验证音频管线时发现三个关联问题:
DEEPSEEK_API_KEY或调用失败时,downgrade_related被填成False、primary_reason填'其他'、confidence填0.0。合规场景无法区分"LLM 判定不涉及降档"和"根本没打标"——真实降档通话会被静默漏报。where直接丢掉,违背"manifest 每条对应输出一行、失败用 status 标记"的项目约定(图片管线已落实,音频没有)。8fd7f35)给llm_prompt新增了concurrency/on_error参数,而 Daft 0.7.15 会把这些 UDF 选项泄漏进 OpenAI 请求 kwargs,SDK 对未知参数直接抛TypeError,每一行都失败(Wire up Daft execution/S3 tuning and fix Ray parallelism collapse #18 之前的调用不传这些参数,工作正常)。fill_null 把失败伪装成"判定为否",所以 Wire up Daft execution/S3 tuning and fix Ray parallelism collapse #18 合入后这个回归完全不可见;修复问题 1 之后它才第一次暴露(全部行变成llm_failed)。图片 VLM 路径在 Add optional VLM image analysis #17 已为同一 Daft 问题写过适配器,音频路径缺失。改动
null 语义(analyze.py)
fill_null,null 就是"没打标"。llm_failed(区别于"没配 key 整批跳过",后者 status 保持ok)。行不丢弃 + status 列(analyze.py / udfs.py / ingest.py / schema.py)
where,改为 status 标记:ok / download_failed / decode_failed / duration_filtered / llm_failed。duration_udf对坏字节返回 null(decode_failed 的判定依据,0.0 会和合法空录音混淆);ASR/prompt/embedding 对非 ok 行走 null 传播,不花模型和 API 成本。blob_download_failed;全 null 列显式 cast 回规范类型,防止"没配 key 的批次打标列全 null → JSONL 推断成 null 类型 → 毒化 Lance 表 schema"。AUDIO_ASSET_SCHEMA增加status字段,README 同步更新。LLM 打标修复(新增 audio/llm.py)
image/vlm.py同一模式的 provider 适配层(按媒体隔离约定各自持有一份):实例化 prompter 前剔除泄漏的 UDF 选项;null prompt(非 ok 行)直接返回 null,不发请求。验证
pytest:104 passed(新增 8 个测试:UDF null 语义 2 个、ingest 台账语义 2 个、LLM 适配层 2 个,及原有测试全绿)。ok;损坏文件decode_failed全 null;JSONL 和 Lance staging 两种输出都验证。downgrade_related=true、primary_reason=价格敏感,call_006判出bad_tone=true;--where "downgrade_related = true AND bad_tone = true"精确命中。