在 App/API 执行 Remove Filler Words 前,先对本地转写稿统计「嗯/那个/um/like」等,预览删除效果。
先看清成品
- 样例稿检出多处口头禅并给出 cleaned_preview。
- 2 项 pytest 通过。
合规提醒:Overdub / 声音克隆仅限本人或已获明确授权并完成平台验证的声音,禁止冒充他人。API token 绑定单一 Drive,可消耗 media minutes 与 AI credits;耗尽可能返回 402。导入勿用未授权媒体;YouTube URL 不作 import 源(官方限制)。本文不编造套餐价格。
运行说明:无正式
DESCRIPT_API_TOKEN。A 用 mock 导出转写;B 本地口头禅扫描;C Overdub 同意门禁。未调用真实 Descript API。2026-10-23(Asia/Shanghai)pytest 通过。
做完之后你会得到什么?
| 成果 | 说明 |
|---|---|
filler_scan.py |
口头禅扫描 |
sample_transcript.txt |
样例 |
test_110b.py |
测试 |
需要准备哪些环境?
| 项目 | 说明 |
|---|---|
| Python | 3.10+ |
关键事实
| 事实 | 来源 |
|---|---|
| 产品可自动去口头禅;API/Underlord 可能耗 AI credits | 官方 Help |
| 本扫描是预览,不改 Descript 工程 | 重要 |
| 过度删除可能伤语气,需人工听回 | 实践 |
文件结构
110-descript-B-src/
├── filler_scan.py
├── sample_transcript.txt
└── test_110b.py
第 1 步:扫描脚本
#!/usr/bin/env python3
"""Scan a local transcript for filler words before Remove Filler Words / text-edit."""
from __future__ import annotations
import argparse, json, re
from pathlib import Path
FILLERS = re.compile(
r"(?i)\b(um+|uh+|er+|ah+|嗯+|额+|那个|就是说|like|you know|basically)\b"
)
def scan(text: str) -> dict:
hits = [{"span": m.span(), "word": m.group(0)} for m in FILLERS.finditer(text)]
# produce a cleaned preview (simple)
cleaned = FILLERS.sub("", text)
cleaned = re.sub(r"[ \t]{2,}", " ", cleaned)
cleaned = re.sub(r" *\n *", "\n", cleaned).strip()
return {"count": len(hits), "hits": hits[:50], "cleaned_preview": cleaned[:2000]}
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument("transcript")
ap.add_argument("-o", "--out", default="")
args = ap.parse_args(argv)
result = scan(Path(args.transcript).read_text(encoding="utf-8"))
text = json.dumps(result, ensure_ascii=False, indent=2)
if args.out:
Path(args.out).write_text(text + "\n", encoding="utf-8")
print(text)
return 0
if __name__ == "__main__":
raise SystemExit(main())
第 2 步:测试
from pathlib import Path
import subprocess, sys
from filler_scan import scan
HERE = Path(__file__).resolve().parent
def test_scan():
r = scan((HERE/"sample_transcript.txt").read_text())
assert r["count"] >= 3
def test_cli():
assert subprocess.run([sys.executable, str(HERE/"filler_scan.py"), str(HERE/"sample_transcript.txt")], capture_output=True).returncode == 0
第 3 步:运行
$ filler_scan
{
"count": 3,
"hits": [
{
"span": [
4,
5
],
"word": "嗯"
},
{
"span": [
23,
32
],
"word": "basically"
},
{
"span": [
40,
48
],
"word": "you know"
}
],
"cleaned_preview": "大家好,,今天我们来聊聊那个产品发布。\n呃, 我们会在下周,,开放测试。"
}
$ pytest -q
.. [100%]
2 passed in 0.03s
怎么检查结果?
- count≥1。
- cleaned_preview 缩短。
调试示例
「就是说」有时是强调。 预览后在 Descript 里选择性应用,不要无脑全删。
常见问题
| 现象 | 原因 | 处理 |
|---|---|---|
| 多语言口头禅 | 扩展 FILLERS | 按团队词表 |
| 要不要 API | 可先本地 | 再 Underlord |
| SRT | 先转纯文本 | 或改脚本 |
模板规则
- 预览再删除。
- 保留必要语气词。
- 注意 credits。
项目资源
| 用途 | 地址 |
|---|---|
| Descript 官网 | https://www.descript.com/ |
| API Help(官方) | https://help.descript.com/api-and-mcp/api |
| API 文档(官方) | https://dev-docs.descriptapi.com/ |
口头禅可删,风格不能删光。