Created
April 11, 2023 18:47
-
-
Save amrakm/3faf613ff166f1f1af7b822bf2506c14 to your computer and use it in GitHub Desktop.
langchain text splitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from langchain.text_splitter import RecursiveCharacterTextSplitter | |
text_splitter = RecursiveCharacterTextSplitter( | |
chunk_size=500, | |
chunk_overlap=20, | |
length_function=tiktoken_len, | |
separators=["\n\n", "\n", " ", ""] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment