This data loader allows loading text files from local storage.
TXTLoader
, you first need to install the purecpp_extract
Python package:
TXTLoader
by providing the path to a .txt
file or a directory containing .txt
files.
Load()
method to extract the contents of the files. This method returns a list of Document
objects.
Each Document
contains the following attributes:
metadata
: A dictionary with metadata about the documentpage_content
: The full text content of the documentDocument
.Document
per .txt
file found in the directory.