load_hidden – Whether to load hidden files. Defaults to False.
loader_cls – Loader class to use for loading files.
Defaults to UnstructuredFileLoader.
loader_kwargs – Keyword arguments to pass to loader_cls. Defaults to None.
recursive – Whether to recursively search for files. Defaults to False.
show_progress – Whether to show a progress bar. Defaults to False.
use_multithreading – Whether to use multithreading. Defaults to False.
max_concurrency – The maximum number of threads to use. Defaults to 4.
sample_size – The maximum number of files you would like to load from the
directory.
randomize_sample – Suffle the files to get a random sample.
sample_seed – set the seed of the random shuffle for reporoducibility.
lazy_load() → Iterator[Document]¶
A lazy loader for Documents.
load() → List[Document][source]¶
Load documents.
load_and_split(text_splitter: Optional[TextSplitter] = None) → List[Document]¶
Load Documents and split into chunks. Chunks are returned as Documents.
Parameters
text_splitter – TextSplitter instance to use for splitting documents.
Defaults to RecursiveCharacterTextSplitter.
Returns
List of Documents.
load_file(item: Path, path: Path, docs: List[Document], pbar: Optional[Any]) → None[source]¶
Load a file.
Parameters
item – File path.
path – Directory path.
docs – List of documents to append to.
pbar – Progress bar. Defaults to None.
Examples using DirectoryLoader¶
StarRocks