mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-11 20:35:14 +03:00
In https://github.com/hwchase17/langchain/issues/1716 , it was identified that there were two .py files performing similar tasks. As a resolution, one of the files has been removed, as its purpose had already been fulfilled by the other file. Additionally, the init has been updated accordingly. Furthermore, the how_to_guides.rst file has been updated to include links to documentation that was previously missing. This was deemed necessary as the existing list on https://langchain.readthedocs.io/en/latest/modules/document_loaders/how_to_guides.html was incomplete, causing confusion for users who rely on the full list of documentation on the left sidebar of the website.
2.8 KiB
2.8 KiB
In [1]:
from langchain.document_loaders import UnstructuredWordDocumentLoaderIn [2]:
loader = UnstructuredWordDocumentLoader("example_data/fake.docx")In [3]:
data = loader.load()In [4]:
dataOut [4]:
[Document(page_content='Lorem ipsum dolor sit amet.', lookup_str='', metadata={'source': 'fake.docx'}, lookup_index=0)]In [5]:
loader = UnstructuredWordDocumentLoader("example_data/fake.docx", mode="elements")In [6]:
data = loader.load()In [7]:
data[0]Out [7]:
Document(page_content='Lorem ipsum dolor sit amet.', lookup_str='', metadata={'source': 'fake.docx', 'filename': 'fake.docx', 'category': 'Title'}, lookup_index=0)