Files
langchain/docs/modules/document_loaders/examples/directory_loader.ipynb
T
2023-02-15 23:24:32 -08:00

1.9 KiB

Directory Loader

This covers how to use the DirectoryLoader to load all documents in a directory. Under the hood, this uses the UnstructuredLoader

In [1]:
from langchain.document_loaders import DirectoryLoader

We can use the glob parameter to control which files to load. Note that here it doesn't load the .rst file or the .ipynb files.

In [7]:
loader = DirectoryLoader('../', glob="**/*.md")
In [8]:
docs = loader.load()
In [9]:
len(docs)
Out [9]:
1
In [ ]: