dsh-ai-subtitle 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +18 -5
- package/README.ja.md +13 -3
- package/README.ko.md +13 -3
- package/README.md +12 -3
- package/client.js +766 -29
- package/docs/DETAIL.md +1 -1
- package/docs/PLAN.md +3 -3
- package/docs/REVIEW.md +105 -0
- package/index.js +191 -5
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +4 -2
- package/scripts/check-client.mjs +17 -0
- package/src/api.js +394 -21
- package/src/cues.js +28 -4
- package/src/feedback.js +59 -0
- package/src/glossary.js +252 -0
- package/src/hints.js +32 -0
- package/src/jobs.js +18 -0
- package/src/llm.js +177 -0
- package/src/messages.js +19 -0
- package/src/paths.js +11 -0
- package/src/recent.js +34 -0
- package/src/review.js +317 -0
- package/src/runtime.js +30 -8
package/README.en.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-ai-subtitle)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
9
|
|
|
10
|
-
<!-- translated-from: README.md sha256:
|
|
10
|
+
<!-- translated-from: README.md sha256:a490558a910c -->
|
|
11
11
|
|
|
12
12
|
A subtitle plugin for DeepSeek Harness (DSH) that turns Japanese video into bilingual
|
|
13
13
|
Japanese/Chinese SRT files. The plugin installs every runtime component it needs
|
|
@@ -35,9 +35,18 @@ video/audio ──ffmpeg──▶ 16 kHz wav ──energy VAD + Whisper──▶
|
|
|
35
35
|
- **Cue editing**: edit the Japanese and Chinese text, split a cue, merge it with the
|
|
36
36
|
next one, adjust either edge in 0.1 s steps, or restore derived timing.
|
|
37
37
|
- **SRT export**: UTF-8 BOM with CRLF line endings, validated against fragment coverage.
|
|
38
|
+
- **Automatic translation**: batches go to the model already configured in DSH, with the glossary and your notes; a manual paste path remains when no model is available.
|
|
39
|
+
- **Background and glossary**: project-level tags and a note join every translation prompt; the
|
|
40
|
+
glossary imports and exports as CSV and rewrites misheard names deterministically.
|
|
41
|
+
- **Japanese proofreading**: an optional pass corrects ASR errors (homophones, dropped words,
|
|
42
|
+
broken sentences) before translating and reports how many lines changed.
|
|
43
|
+
- **Projects folder**: defaults to Documents, can be moved with the existing projects, and opens
|
|
44
|
+
in the file manager from the panel.
|
|
45
|
+
- **Recent files**: the media picker expands into recent files and folders.
|
|
46
|
+
- **Line deletion**: deleting a cue marks it as skipped, so coverage and export stay valid.
|
|
38
47
|
- **File browser**: in-app picker with quick locations that remembers the last directory.
|
|
39
48
|
|
|
40
|
-
Not implemented yet:
|
|
49
|
+
Not implemented yet: ASS export with styling.
|
|
41
50
|
|
|
42
51
|
## Installation
|
|
43
52
|
|
|
@@ -69,7 +78,7 @@ provides a settings section and a right-sidebar tab. From top to bottom:
|
|
|
69
78
|
migration, and the download sources with their measured speed (re-probe on demand).
|
|
70
79
|
- **Transcribe**: media path with a **Browse** button, then start.
|
|
71
80
|
- **Tasks**: progress bar, phase, log tail, and a **Cancel** button while running.
|
|
72
|
-
- **Projects**: pin, show
|
|
81
|
+
- **Projects**: pin, show removed, change or open the projects folder, delete (reference only or with the local files). Opening
|
|
73
82
|
a project shows a dialog for SRT export, `cues.json` import, cue editing and preview.
|
|
74
83
|
|
|
75
84
|
## Agent tools
|
|
@@ -81,6 +90,8 @@ provides a settings section and a right-sidebar tab. From top to bottom:
|
|
|
81
90
|
| `subtitle_transcribe` | transcribe a video or audio file into `asr.json` |
|
|
82
91
|
| `subtitle_job` | job progress and result (`waitSeconds` blocks) |
|
|
83
92
|
| `subtitle_export` | build the bilingual SRT from `asr.json` and cue files (coverage validated) |
|
|
93
|
+
| `subtitle_review` | batch review: take a batch, apply the returned lines, validate coverage and glossary ([docs/REVIEW.md](docs/REVIEW.md)) |
|
|
94
|
+
| `subtitle_glossary` | glossary: show, export to CSV, import and merge from a file or an online URL |
|
|
84
95
|
|
|
85
96
|
## Data and routes
|
|
86
97
|
|
|
@@ -133,8 +144,10 @@ installation. A migration leaves a pointer to the new location at
|
|
|
133
144
|
- **Segment timestamps**: `return_timestamps="word"` raises `IndexError` with
|
|
134
145
|
transformers 5.x and this model, so each fragment has a start and end but no per-word
|
|
135
146
|
timing.
|
|
136
|
-
- **
|
|
137
|
-
|
|
147
|
+
- **Translation uses the configured model**: the plugin calls the DSH model service, so no extra
|
|
148
|
+
API key is needed; a manual paste path remains when no model is available.
|
|
149
|
+
- **Panel language**: the panel ships in Simplified Chinese only; the plugin entry title and
|
|
150
|
+
description are translated (English and Chinese).
|
|
138
151
|
- The first install downloads about 3 GB (the CUDA build and the model) and needs a stable
|
|
139
152
|
network.
|
|
140
153
|
|
package/README.ja.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-ai-subtitle)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
9
|
|
|
10
|
-
<!-- translated-from: README.md sha256:
|
|
10
|
+
<!-- translated-from: README.md sha256:a490558a910c -->
|
|
11
11
|
|
|
12
12
|
DeepSeek Harness(DSH)の字幕プラグインです。日本語動画を日中バイリンガルの SRT に変換します。必要なランタイム(ffmpeg、CPython、PyTorch、transformers)は指定ディレクトリにすべて導入されるため、Python・ffmpeg・モデルを事前に用意する必要はありません。
|
|
13
13
|
|
|
@@ -25,9 +25,15 @@ DeepSeek Harness(DSH)の字幕プラグインです。日本語動画を日
|
|
|
25
25
|
- **プロジェクト管理**:ピン留め、非表示、参照のみ削除・ローカルファイルごと削除の 2 種類。
|
|
26
26
|
- **キュー編集**:日本語と中国語のテキスト編集、分割、次のキューとの結合、開始・終了時刻の 0.1 秒調整、自動時刻への復元。
|
|
27
27
|
- **SRT 出力**:UTF-8 BOM と CRLF、出力前にフラグメント被覆を検証します。
|
|
28
|
+
- **自動翻訳**:DSH に設定済みのモデルへバッチ単位で送信し、用語集とあなたの意見を添えます。モデルが使えない場合は手動貼り付けも可能です。
|
|
29
|
+
- **背景と用語**:プロジェクト単位のタグと説明を毎回の翻訳プロンプトに含めます。用語集は CSV で入出力でき、聞き間違いの修正にも対応します。
|
|
30
|
+
- **日本語の校正**:翻訳前に認識誤り(同音異義語・抜け・句切り)を校正でき、変更件数を報告します。
|
|
31
|
+
- **プロジェクトフォルダー**:既定は「ドキュメント」配下。変更と既存プロジェクトの移行ができ、エクスプローラーで開けます。
|
|
32
|
+
- **最近使った項目**:メディア選択時に最近のファイルとフォルダーを展開できます。
|
|
33
|
+
- **行の削除**:不要な行は削除(内部的にはスキップ)でき、カバレッジと書き出しに影響しません。
|
|
28
34
|
- **ファイル参照**:内蔵ブラウザ。クイック位置を備え、前回のディレクトリを記憶します。
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
未実装:ASS 出力(スタイル付き字幕)。
|
|
31
37
|
|
|
32
38
|
## 導入
|
|
33
39
|
|
|
@@ -65,6 +71,8 @@ DSH のメインパネルと左ナビゲーションの項目として登録さ
|
|
|
65
71
|
| `subtitle_transcribe` | 動画または音声を `asr.json` に書き出す |
|
|
66
72
|
| `subtitle_job` | タスクの進捗と結果(`waitSeconds` で待機) |
|
|
67
73
|
| `subtitle_export` | `asr.json` とキュー定義から SRT を出力(被覆を検証) |
|
|
74
|
+
| `subtitle_review` | バッチ校正:バッチ取得、返却行の反映、被覆と用語の検証([docs/REVIEW.md](docs/REVIEW.md)) |
|
|
75
|
+
| `subtitle_glossary` | 用語集:表示、CSV 出力、ファイルまたはオンライン URL から取り込み・統合 |
|
|
68
76
|
|
|
69
77
|
## データと API
|
|
70
78
|
|
|
@@ -104,7 +112,9 @@ DSH のメインパネルと左ナビゲーションの項目として登録さ
|
|
|
104
112
|
|
|
105
113
|
- **Windows のみ**:ffmpeg のパッケージとパス処理は Windows を前提としています。
|
|
106
114
|
- **区間単位の時刻**:transformers 5.x と kotoba-whisper の `return_timestamps="word"` は `IndexError` を送出するため、フラグメントごとの開始・終了時刻のみで、単語単位の時刻はありません。
|
|
107
|
-
-
|
|
115
|
+
- **翻訳は設定済みモデルに依存**:DSH のモデルサービスを呼ぶため API key の追加設定は不要です。
|
|
116
|
+
モデルが使えない場合は手動貼り付けに切り替えられます。
|
|
117
|
+
- **パネルの言語**:パネルは簡体字中国語のみです。プラグイン入口のタイトルと説明は英語・中国語の二言語です。
|
|
108
118
|
- 初回導入は約 3 GB(CUDA 版 PyTorch とモデル)で、安定した回線が必要です。
|
|
109
119
|
|
|
110
120
|
## 開発
|
package/README.ko.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-ai-subtitle)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
9
|
|
|
10
|
-
<!-- translated-from: README.md sha256:
|
|
10
|
+
<!-- translated-from: README.md sha256:a490558a910c -->
|
|
11
11
|
|
|
12
12
|
DeepSeek Harness(DSH)용 자막 플러그인으로, 일본어 영상을 일중 이중 언어 SRT로 변환합니다. 필요한 런타임(ffmpeg, CPython, PyTorch, transformers)은 지정한 디렉터리에 모두 설치되므로 Python, ffmpeg, 모델을 미리 준비할 필요가 없습니다.
|
|
13
13
|
|
|
@@ -25,9 +25,15 @@ DeepSeek Harness(DSH)용 자막 플러그인으로, 일본어 영상을 일중
|
|
|
25
25
|
- **프로젝트 관리**: 고정, 숨김, 참조만 삭제 또는 로컬 파일까지 삭제의 두 가지 방식.
|
|
26
26
|
- **큐 편집**: 일본어와 중국어 텍스트 수정, 분할, 다음 큐와 병합, 시작·종료 시각을 0.1초 단위로 조정, 자동 시각 복원.
|
|
27
27
|
- **SRT 내보내기**: UTF-8 BOM과 CRLF를 사용하며, 내보내기 전에 프래그먼트 커버리지를 검증합니다.
|
|
28
|
+
- **자동 번역**: DSH에 설정된 모델로 배치를 보내며 용어집과 사용자 의견을 함께 전달합니다. 모델을 쓸 수 없으면 수동 붙여넣기도 가능합니다.
|
|
29
|
+
- **배경과 용어**: 프로젝트 단위 태그와 설명이 매번 번역 프롬프트에 포함됩니다. 용어집은 CSV로 가져오기/내보내기가 가능하며 잘못 들은 이름도 수정합니다.
|
|
30
|
+
- **일본어 교정**: 번역 전에 인식 오류(동음어, 누락, 끊어 읽기)를 교정하고 변경된 줄 수를 보고합니다.
|
|
31
|
+
- **프로젝트 폴더**: 기본은 "문서" 폴더이며 변경과 기존 프로젝트 이동을 지원하고 탐색기에서 열 수 있습니다.
|
|
32
|
+
- **최근 사용**: 미디어 선택 시 최근 파일과 폴더를 펼쳐 볼 수 있습니다.
|
|
33
|
+
- **줄 삭제**: 필요 없는 줄을 삭제(내부적으로 건너뛰기)해도 커버리지와 내보내기에 영향이 없습니다.
|
|
28
34
|
- **파일 찾아보기**: 내장 브라우저로 빠른 위치를 제공하고 마지막 디렉터리를 기억합니다.
|
|
29
35
|
|
|
30
|
-
미구현:
|
|
36
|
+
미구현: ASS 내보내기(스타일 자막).
|
|
31
37
|
|
|
32
38
|
## 설치
|
|
33
39
|
|
|
@@ -65,6 +71,8 @@ DSH의 메인 패널과 왼쪽 내비게이션 항목으로 등록되며, 설정
|
|
|
65
71
|
| `subtitle_transcribe` | 영상 또는 오디오를 `asr.json`으로 전사 |
|
|
66
72
|
| `subtitle_job` | 작업 진행률과 결과(`waitSeconds`로 대기) |
|
|
67
73
|
| `subtitle_export` | `asr.json`과 큐 파일로 SRT 내보내기(커버리지 검증) |
|
|
74
|
+
| `subtitle_review` | 배치 교정: 배치 가져오기, 반환된 줄 반영, 커버리지·용어 검증([docs/REVIEW.md](docs/REVIEW.md)) |
|
|
75
|
+
| `subtitle_glossary` | 용어집: 조회, CSV 내보내기, 파일 또는 온라인 URL에서 가져와 병합 |
|
|
68
76
|
|
|
69
77
|
## 데이터와 API
|
|
70
78
|
|
|
@@ -104,7 +112,9 @@ DSH의 메인 패널과 왼쪽 내비게이션 항목으로 등록되며, 설정
|
|
|
104
112
|
|
|
105
113
|
- **Windows 전용**: ffmpeg 패키지와 경로 처리가 Windows를 전제로 합니다.
|
|
106
114
|
- **구간 단위 시각**: transformers 5.x와 kotoba-whisper의 `return_timestamps="word"`는 `IndexError`를 발생시키므로 프래그먼트마다 시작·종료 시각만 있고 단어 단위 시각은 없습니다.
|
|
107
|
-
-
|
|
115
|
+
- **번역은 설정된 모델 사용**: DSH 모델 서비스를 호출하므로 추가 API key가 필요 없습니다.
|
|
116
|
+
모델을 쓸 수 없으면 수동 붙여넣기로 전환할 수 있습니다.
|
|
117
|
+
- **패널 언어**: 패널은 현재 중국어 간체만 지원합니다. 플러그인 진입점의 제목과 설명은 영어/중국어 두 가지입니다.
|
|
108
118
|
- 첫 설치에 약 3 GB(CUDA 빌드와 모델)를 내려받으며 안정적인 회선이 필요합니다.
|
|
109
119
|
|
|
110
120
|
## 개발
|
package/README.md
CHANGED
|
@@ -23,9 +23,15 @@ DeepSeek Harness(DSH)的字幕插件,把日语视频转成中日双语 SRT
|
|
|
23
23
|
- **项目管理**:置顶、隐藏;删除时可选仅移除引用或连同本地文件删除。
|
|
24
24
|
- **cue 编辑**:修改日文与中文、拆分、与下一条合并、起止时间按 0.1 秒调整、恢复自动时间。
|
|
25
25
|
- **SRT 导出**:UTF-8 BOM 与 CRLF 行尾,导出前校验碎片覆盖率。
|
|
26
|
+
- **自动翻译**:按批调用 DSH 已配置的模型,带上术语表与你的意见;模型不可用时仍可手动粘贴译文。
|
|
27
|
+
- **背景与术语**:项目级标签与说明会随每次翻译进入提示词;术语表可导入导出 CSV,并支持误听修正。
|
|
28
|
+
- **校对日文**:翻译前可选校正识别错误(同音字、漏字、断句),并报告改动了多少条。
|
|
29
|
+
- **项目目录**:默认在「文档」下,可自定义并迁移现有项目;可一键在资源管理器中打开。
|
|
30
|
+
- **最近使用**:浏览媒体时可展开最近用过的文件与文件夹。
|
|
31
|
+
- **逐条删除**:不需要的行直接删除(内部记为跳过段),不影响覆盖率与导出。
|
|
26
32
|
- **文件浏览**:内置文件浏览器,提供快捷位置并记住上次访问的目录。
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
尚未实现:ASS 导出(带样式的字幕)。
|
|
29
35
|
|
|
30
36
|
## 安装
|
|
31
37
|
|
|
@@ -50,7 +56,7 @@ dsh plugin --profile <profile> add link:/path/to/dsh-ai-subtitle
|
|
|
50
56
|
- **运行时**(默认折叠):安装与修复、是否同时下载模型、整体迁移、下载源及其测得速率(可重新测速)。
|
|
51
57
|
- **转写**:媒体路径与「浏览」按钮,随后开始转写。
|
|
52
58
|
- **任务**:进度条、阶段、日志尾部;运行中的任务右侧有「取消」。
|
|
53
|
-
-
|
|
59
|
+
- **项目**:置顶、显示已移除、删除(仅移除引用或连本地文件一起删除),可更改或打开项目目录;打开项目后可在弹窗中自动翻译、逐条修改(含删除)、导出字幕。
|
|
54
60
|
|
|
55
61
|
## Agent 工具
|
|
56
62
|
|
|
@@ -61,6 +67,8 @@ dsh plugin --profile <profile> add link:/path/to/dsh-ai-subtitle
|
|
|
61
67
|
| `subtitle_transcribe` | 转写视频或音频,产出 `asr.json` |
|
|
62
68
|
| `subtitle_job` | 查询任务进度与结果(`waitSeconds` 可阻塞等待) |
|
|
63
69
|
| `subtitle_export` | 由 `asr.json` 与 cue 文件导出双语 SRT(校验覆盖率) |
|
|
70
|
+
| `subtitle_review` | 分批校对:取批次、回填译文、校验覆盖率与术语(见 [docs/REVIEW.md](docs/REVIEW.md)) |
|
|
71
|
+
| `subtitle_glossary` | 术语表:查看、导出为 CSV、从文件或在线链接导入并合并 |
|
|
64
72
|
|
|
65
73
|
## 数据与接口
|
|
66
74
|
|
|
@@ -100,7 +108,8 @@ dsh plugin --profile <profile> add link:/path/to/dsh-ai-subtitle
|
|
|
100
108
|
|
|
101
109
|
- **仅 Windows**:ffmpeg 静态包与路径处理按 Windows 实现。
|
|
102
110
|
- **段级时间戳**:transformers 5.x 与 kotoba-whisper 的 `return_timestamps="word"` 会抛出 `IndexError`,因此每条碎片只有起止时间,没有逐词时间。
|
|
103
|
-
-
|
|
111
|
+
- **翻译依赖已配置的模型**:插件通过 DSH 的模型服务自动翻译,不需要另外配置 API key;模型不可用时仍可手动粘贴。
|
|
112
|
+
- **界面语言**:面板目前只有简体中文;插件入口的标题与说明提供中英两版。
|
|
104
113
|
- 首次安装约 3 GB(CUDA 版 PyTorch 与模型),需要稳定网络。
|
|
105
114
|
|
|
106
115
|
## 开发
|