Skip to main content
Character-based splitting is the simplest approach to text splitting. It divides text using a specified character sequence (default: "\n\n"), with chunk length measured by the number of characters. 关键要点
  1. 如何分割文本:按给定的字符分隔符。
  2. 如何衡量分块大小:按字符数。
You can choose between:
  • .split_text — returns plain string chunks.
  • .create_documents — returns LangChain Document objects, useful when metadata needs to be preserved for downstream tasks.
Use .create_documents to propagate metadata associated with each document to the output chunks:
Use .split_text to obtain the string content directly: