Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,12 +28,12 @@ def get_pdf_text(pdf_docs):
|
|
28 |
# 과제
|
29 |
# 아래 텍스트 추출 함수를 작성
|
30 |
|
31 |
-
def get_text_file(
|
32 |
# 텍스트 파일의 경우, 내용을 바로 읽어옵니다.
|
33 |
text_content = docs.getvalue().decode("utf-8") # UTF-8 인코딩을 기준으로 디코딩합니다.
|
34 |
return [text_content]
|
35 |
|
36 |
-
def get_csv_file(
|
37 |
# CSV 파일의 경우, 각 행 또는 열에서 텍스트를 추출합니다.
|
38 |
import pandas as pd
|
39 |
csv_content = docs.getvalue().decode("utf-8") # 바이트를 문자열로 디코딩합니다.
|
@@ -46,7 +46,7 @@ def get_csv_file(docs):
|
|
46 |
|
47 |
return text_list
|
48 |
|
49 |
-
def get_json_file(
|
50 |
# JSON 파일의 경우, 특정 키 또는 값에서 텍스트를 추출합니다.
|
51 |
import json
|
52 |
json_content = docs.getvalue().decode("utf-8") # 바이트를 문자열로 디코딩합니다.
|
|
|
28 |
# 과제
|
29 |
# 아래 텍스트 추출 함수를 작성
|
30 |
|
31 |
+
def get_text_file(text_docs):
|
32 |
# 텍스트 파일의 경우, 내용을 바로 읽어옵니다.
|
33 |
text_content = docs.getvalue().decode("utf-8") # UTF-8 인코딩을 기준으로 디코딩합니다.
|
34 |
return [text_content]
|
35 |
|
36 |
+
def get_csv_file(csv_docs):
|
37 |
# CSV 파일의 경우, 각 행 또는 열에서 텍스트를 추출합니다.
|
38 |
import pandas as pd
|
39 |
csv_content = docs.getvalue().decode("utf-8") # 바이트를 문자열로 디코딩합니다.
|
|
|
46 |
|
47 |
return text_list
|
48 |
|
49 |
+
def get_json_file(json_docs):
|
50 |
# JSON 파일의 경우, 특정 키 또는 값에서 텍스트를 추출합니다.
|
51 |
import json
|
52 |
json_content = docs.getvalue().decode("utf-8") # 바이트를 문자열로 디코딩합니다.
|