Zack Saadioui
8/24/2024
1
TextLoader
1
pip install langchain
1
2
``
In this example, we've defined a directory path and specified that we want to load all Markdown files within. The
1
method then populates the
1 2 3 4
from langchain_community.document_loaders import TextLoader loader = DirectoryLoader('/path/to/your/directory', glob='**/*.txt', loader_cls=TextLoader) docs = loader.load()
1
2
python
loader = DirectoryLoader('../', glob='**/*.pdf')
1
tqdm
1
2
3
python
loader = DirectoryLoader('../', glob='**/*.pdf', show_progress=True)
docs = loader.load()
1
2
3
python
loader = DirectoryLoader('../', glob='**/*.csv', use_multithreading=True)
docs = loader.load()
1
2
3
python
loader = DirectoryLoader('../', glob='**/*.txt', silent_errors=True)
docs = loader.load()
1
DirectoryLoader
1
.csv
Copyright © Arsturn 2025