Skip to content

Commit

Permalink
correct name of doc/docx loader
Browse files Browse the repository at this point in the history
  • Loading branch information
BBC-Esq authored Jan 7, 2024
1 parent 73dd68d commit cbd4766
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@

DOCUMENT_LOADERS = {
".pdf": "PyMuPDFLoader",
".docx": "Docx2txtLoader",
".docx": "UnstructuredWordDocumentLoader",
".doc": "UnstructuredWordDocumentLoader",
".txt": "TextLoader",
".enex": "EverNoteLoader",
".epub": "UnstructuredEPubLoader",
Expand Down
4 changes: 2 additions & 2 deletions src/document_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.document_loaders import (
PyMuPDFLoader,
Docx2txtLoader,
UnstructuredWordDocumentLoader,
TextLoader,
EverNoteLoader,
UnstructuredEPubLoader,
Expand Down Expand Up @@ -67,7 +67,7 @@ def load_single_document(file_path: Path) -> Document:
elif file_extension == ".epub":
loader = UnstructuredEPubLoader(str(file_path), mode="single", strategy="fast")
elif file_extension == ".docx":
loader = Docx2txtLoader(str(file_path), mode="single", strategy="fast")
loader = UnstructuredWordDocumentLoader(str(file_path), mode="single", strategy="fast")
elif file_extension == ".rtf":
loader = UnstructuredRTFLoader(str(file_path), mode="single", strategy="fast")
elif file_extension == ".odt":
Expand Down

0 comments on commit cbd4766

Please sign in to comment.