Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def get_text_file(text_docs):
|
|
33 |
temp_filepath1 = os.path.join(temp_dir1.name, text_docs.name) # 임시 파일 경로를 생성합니다.
|
34 |
with open(temp_filepath1, "wb") as f: # 임시 파일을 바이너리 쓰기 모드로 엽니다.
|
35 |
f.write(text_docs.getvalue()) # PDF 문서의 내용을 임시 파일에 씁니다.
|
36 |
-
text_loader =
|
37 |
text_doc = text_loader.load() # 텍스트를 추출합니다.
|
38 |
return text_doc # 추출한 텍스트를 반환합니다.
|
39 |
|
|
|
33 |
temp_filepath1 = os.path.join(temp_dir1.name, text_docs.name) # 임시 파일 경로를 생성합니다.
|
34 |
with open(temp_filepath1, "wb") as f: # 임시 파일을 바이너리 쓰기 모드로 엽니다.
|
35 |
f.write(text_docs.getvalue()) # PDF 문서의 내용을 임시 파일에 씁니다.
|
36 |
+
text_loader = TextLoader(temp_filepath1) # PyPDFLoader를 사용해 PDF를 로드합니다.
|
37 |
text_doc = text_loader.load() # 텍스트를 추출합니다.
|
38 |
return text_doc # 추출한 텍스트를 반환합니다.
|
39 |
|