Skip to main content
Open In ColabOpen on GitHub

CoNLL-U

CoNLL-U is revised version of the CoNLL-X format. Annotations are encoded in plain text files (UTF-8, normalized to NFC, using only the LF character as line break, including an LF character at the end of file) with three types of lines:

  • Word lines containing the annotation of a word/token in 10 fields separated by single tab characters; see below.
  • Blank lines marking sentence boundaries.
  • Comment lines starting with hash (#).

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

from langchain_community.document_loaders import CoNLLULoader
API 参考: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'})]