跳到主要內容

CoNLL-U

CoNLL-U 是 CoNLL-X 格式的修訂版本。註釋以純文字檔案(UTF-8,標準化為 NFC,僅使用 LF 字元作為換行符,包括檔案末尾的 LF 字元)編碼,其中包含三種類型的行

  • 單詞行,包含以單個 Tab 字元分隔的 10 個欄位中單詞/符記的註釋;請參閱下文。
  • 標記句子邊界的空白行。
  • 以井號 (#) 開頭的註解行。

這是一個如何在 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'})]

此頁面是否有幫助?