Skip to main content

CoNLL-U

CoNLL-U 是 CoNLL-X 格式的修订版。注释以纯文本文件(UTF-8,标准化为 NFC,仅使用 LF 字符作为换行符,文件末尾包含一个 LF 字符)编码,包含三种类型的行:

  • 单词行,包含一个单词/标记的注释,分为 10 个字段,用单个制表符分隔;见下文。
  • 空行,标记句子边界。
  • 以井号 (#) 开头的注释行。

这是如何加载 CoNLL-U 格式文件的示例。整个文件被视为一个文档。示例数据 (conllu.conllu) 基于标准的 UD/CoNLL-U 示例之一。

from langchain_community.document_loaders import CoNLLULoader
loader = CoNLLULoader("example_data/conllu.conllu")
document = loader.load()
document
[Document(page_content='They buy and sell books.', metadata={'source': 'example_data/conllu.conllu'})]

相关


此页面是否有帮助?


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