LeeRuben commited on
Commit
3f47dc3
Β·
1 Parent(s): 197a291

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
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') # 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
- # JSON 파일의 ν•„μš”ν•œ ν‚€μ—μ„œ ν…μŠ€νŠΈ μΆ”μΆœ
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