01. Character text split (CharacterTextSplitter)
CharacterTextSplitter
%pip install -qU langchain-text-splitters# data/appendix-keywords.txt Opens a file and creates a file object called f.
with open("./data/appendix-keywords.txt") as f:
file = f.read() # Read the contents of the file Store it in a variable.# Prints some of the content read from the file.Specifies the delimiter to use when splitting text. The default is "\n\n".
print(file[:500])PreviousCH07 text split (Text Splitter)Next02. Securitic text text split (RecursiveCharacterTextSplitter)
Last updated