Skip to content

feat(converters): add SubtitleToDocument for SRT and WebVTT - #13404

Draft
ninglinLiu wants to merge 2 commits into
deepset-ai:mainfrom
ninglinLiu:fix/subtitle-to-document-13395
Draft

ninglinLiu wants to merge 2 commits into
deepset-ai:mainfrom
ninglinLiu:fix/subtitle-to-document-13395

Conversation

@ninglinLiu

Copy link
Copy Markdown

Related issue

Fixes #13395

Summary

Adds a stdlib-only SubtitleToDocument converter (modeled on TextFileToDocument) that:

  • Reads .srt and .vtt
  • Strips cue numbers, timing lines, NOTE/STYLE/REGION blocks, and common inline tags
  • Groups consecutive cues into Documents via cues_per_document (default 10; None = one Document per file)
  • Sets start_time / end_time (float seconds) on each Document from the first/last cue in the group
  • Warns and skips unreadable sources or files with no valid cues

MultiFileConverter routing is intentionally unchanged (as discussed in the issue) so existing .srt → TextFileToDocument behavior stays intact.

Verification

pytest test/components/converters/test_subtitle_to_document.py -q
# 6 passed

Fixes deepset-ai#13395

Stdlib-only converter modeled on TextFileToDocument. Strips cue
numbers, timing lines, NOTE blocks and inline tags; groups cues into
Documents with start_time/end_time metadata. MultiFileConverter
routing left unchanged.
@ninglinLiu
ninglinLiu requested a review from a team as a code owner October 23, 2026 03:38
@ninglinLiu
ninglinLiu requested review from julian-risch and removed request for a team October 23, 2026 03:38
@vercel

vercel Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@ninglinLiu is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@HaystackBot

Copy link
Copy Markdown
Contributor

Hi @ninglinLiu, thanks a lot for your contribution! 🙏

We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.

To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.

@HaystackBot
HaystackBot removed the request for review from julian-risch October 23, 2026 04:54
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Oct 23, 2026
@HaystackBot
HaystackBot marked this pull request as draft October 23, 2026 04:54
@github-actions github-actions Bot added the P3 Low priority, leave it in the backlog label Oct 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-pending PR is in draft until the contributor signs the CLA P3 Low priority, leave it in the backlog topic:tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a converter for SRT and WebVTT subtitle files

3 participants