text_splitter = SpacyTextSplitter(chunk_size=512) parser = SimpleNodeParser.from_defaults(text_splitter=text_splitter) documents = SimpleDirectoryReader(file_path, filename_as_id=True).load_data() parser.get_nodes_from_documents(documents)