Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def get_pdf_text(pdf_docs):
|
|
33 |
def get_text_file(docs):
|
34 |
text_list = []
|
35 |
for doc in docs:
|
36 |
-
text = doc.getvalue().decode('utf-8')
|
37 |
text_list.append(text)
|
38 |
return text_list
|
39 |
|
@@ -41,8 +41,6 @@ def get_csv_file(docs):
|
|
41 |
text_list = []
|
42 |
for doc in docs:
|
43 |
df = pd.read_csv(doc)
|
44 |
-
# CSV νμΌμ νΉμ μ΄μ΄λ νμμ ν
μ€νΈ μΆμΆ
|
45 |
-
# μμ: 첫 λ²μ§Έ μ΄μ λ°μ΄ν°λ₯Ό ν
μ€νΈλ‘ λ³ν
|
46 |
text = ' '.join(df.iloc[:, 0].astype(str).tolist())
|
47 |
text_list.append(text)
|
48 |
return text_list
|
@@ -51,9 +49,7 @@ def get_json_file(docs):
|
|
51 |
text_list = []
|
52 |
for doc in docs:
|
53 |
data = json.load(doc)
|
54 |
-
|
55 |
-
# μμ: 'text' ν€μμ ν
μ€νΈ μΆμΆ
|
56 |
-
text = data.get('text', '') # νμν ν€ μ
λ ₯
|
57 |
text_list.append(text)
|
58 |
return text_list
|
59 |
|
|
|
33 |
def get_text_file(docs):
|
34 |
text_list = []
|
35 |
for doc in docs:
|
36 |
+
text = doc.getvalue().decode('utf-8')
|
37 |
text_list.append(text)
|
38 |
return text_list
|
39 |
|
|
|
41 |
text_list = []
|
42 |
for doc in docs:
|
43 |
df = pd.read_csv(doc)
|
|
|
|
|
44 |
text = ' '.join(df.iloc[:, 0].astype(str).tolist())
|
45 |
text_list.append(text)
|
46 |
return text_list
|
|
|
49 |
text_list = []
|
50 |
for doc in docs:
|
51 |
data = json.load(doc)
|
52 |
+
text = data.get('text', '')
|
|
|
|
|
53 |
text_list.append(text)
|
54 |
return text_list
|
55 |
|