TokenTextSplitter

AI・ML

LangChainで日本語チャンキングが文字化けする原因、TokenTextSplitterでした

LangChainのTokenTextSplitterで日本語をチャンキングすると「�」などの文字化けが発生する原因と、公式推奨の回避策を解説。RecursiveCharacterTextSplitter/CharacterTextSplitter.from_tiktoken_encoderへの置き換えコードと検証結果を掲載。