跳到主要内容

字幕

此示例介绍了如何从字幕文件加载数据。将为每个字幕文件创建一个文档。

设置

npm install srt-parser-2

用法

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();

此页面是否对您有帮助?


您也可以留下详细的反馈 在 GitHub 上.

© . This site is unofficial and not affiliated with LangChain, Inc.
这些文档随着 LangChain v1.0 在 2025 年 10 月的发布而弃用,并且不再维护。 请访问 v1.0 文档