Sk4467 commited on
Commit
3c4744f
1 Parent(s): 2588872

Update file_processing.py

Browse files
Files changed (1) hide show
  1. file_processing.py +2 -2
file_processing.py CHANGED
@@ -8,7 +8,7 @@ from dotenv import load_dotenv
8
  # load_dotenv(r'C:\Users\sksha\Desktop\llm-assignment-master\llm-assignment-master\llm-assignment-master_\backend\.env')
9
  openai_api_key = os.environ.get('OPENAI_API_KEY')
10
  from langchain.document_loaders import TextLoader, PDFMinerLoader, UnstructuredWordDocumentLoader, CSVLoader
11
- from langchain_community.document_loaders import PyMuPDFLoader,TextLoader,CSVLoader,Docx2txtLoader
12
 
13
  # def load_documents(file_path):
14
  # if file_path.endswith('.txt'):
@@ -38,7 +38,7 @@ def read_pdf(file_path: str) -> str:
38
  return text
39
 
40
  def read_docx(file_path: str) -> str:
41
- loader=Docx2txtLoader(file_path)
42
  text=loader.load()
43
  return text
44
 
 
8
  # load_dotenv(r'C:\Users\sksha\Desktop\llm-assignment-master\llm-assignment-master\llm-assignment-master_\backend\.env')
9
  openai_api_key = os.environ.get('OPENAI_API_KEY')
10
  from langchain.document_loaders import TextLoader, PDFMinerLoader, UnstructuredWordDocumentLoader, CSVLoader
11
+ from langchain_community.document_loaders import PyMuPDFLoader,TextLoader,CSVLoader,Docx2txtLoader,UnstructuredWordDocumentLoader
12
 
13
  # def load_documents(file_path):
14
  # if file_path.endswith('.txt'):
 
38
  return text
39
 
40
  def read_docx(file_path: str) -> str:
41
+ loader=UnstructuredWordDocumentLoader(file_path)
42
  text=loader.load()
43
  return text
44