SeoJunn commited on
Commit
0d57ec4
·
1 Parent(s): c9de9e0

Refactor : pdf를 제외한 확장자 처리 함수 pass로 변경

Browse files
Files changed (1) hide show
  1. app.py +3 -20
app.py CHANGED
@@ -30,30 +30,13 @@ def get_pdf_text(pdf_docs):
30
  # 과제
31
  # 아래 텍스트 추출 함수를 작성
32
  def get_text_file(docs):
33
- text = docs.read()
34
- return text
35
 
36
  def get_csv_file(docs):
37
- with tempfile.NamedTemporaryFile(delete=False, suffix=".csv") as temp_file:
38
- temp_filepath = temp_file.name
39
- temp_file.write(docs.read())
40
-
41
- csv_data = pd.read_csv(temp_filepath)
42
-
43
- os.remove(temp_filepath)
44
-
45
- return csv_data
46
 
47
  def get_json_file(docs):
48
- with tempfile.NamedTemporaryFile(delete=False, suffix=".json") as temp_file:
49
- temp_filepath = temp_file.name
50
- temp_file.write(docs.read())
51
-
52
- json_data = json.load(open(temp_filepath, 'r'))
53
-
54
- os.remove(temp_filepath)
55
-
56
- return json_data
57
 
58
 
59
  # 문서들을 처리하여 텍스트 청크로 나누는 함수입니다.
 
30
  # 과제
31
  # 아래 텍스트 추출 함수를 작성
32
  def get_text_file(docs):
33
+ pass
 
34
 
35
  def get_csv_file(docs):
36
+ pass
 
 
 
 
 
 
 
 
37
 
38
  def get_json_file(docs):
39
+ pass
 
 
 
 
 
 
 
 
40
 
41
 
42
  # 문서들을 처리하여 텍스트 청크로 나누는 함수입니다.