Skip to main content
These docs will be deprecated and no longer maintained with the release of LangChain v1.0 in October 2025. Visit the v1.0 alpha docs

Subtitles

This example goes over how to load data from subtitle files. One document will be created for each subtitles file.

Setup

  • npm
  • Yarn
  • pnpm
npm install srt-parser-2

Usage

import { SRTLoader } from "@langchain/community/document_loaders/fs/srt";

const loader = new SRTLoader(
"src/document_loaders/example_data/Star_Wars_The_Clone_Wars_S06E07_Crisis_at_the_Heart.srt"
);

const docs = await loader.load();

Was this page helpful?


You can also leave detailed feedback on GitHub.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.