feat: changed doc_file to docx and update readme (#157)
This commit is contained in:
committed by
GitHub
parent
51adc5c886
commit
0bb3d0afe9
12
embedchain/loaders/docx_file.py
Normal file
12
embedchain/loaders/docx_file.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from langchain.document_loaders import Docx2txtLoader
|
||||
|
||||
class DocxFileLoader:
|
||||
def load_data(self, url):
|
||||
loader = Docx2txtLoader(url)
|
||||
output = []
|
||||
data = loader.load()
|
||||
content = data[0].page_content
|
||||
meta_data = data[0].metadata
|
||||
meta_data["url"] = "local"
|
||||
output.append({"content": content, "meta_data": meta_data})
|
||||
return output
|
||||
Reference in New Issue
Block a user