Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def get_text_file(text_docs):
|
|
33 |
temp_filepath = os.path.join(temp_dir.name, text_docs.name) # μμ νμΌ κ²½λ‘λ₯Ό μμ±ν©λλ€.
|
34 |
with open(temp_filepath, "wb") as f: # μμ νμΌμ λ°μ΄λ리 μ°κΈ° λͺ¨λλ‘ μ½λλ€.
|
35 |
f.write(text_docs.getvalue())
|
36 |
-
text_loader =
|
37 |
text_doc = text_loader.load()
|
38 |
return text_doc
|
39 |
|
@@ -51,7 +51,11 @@ def get_json_file(json_docs):
|
|
51 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name) # μμ νμΌ κ²½λ‘λ₯Ό μμ±ν©λλ€.
|
52 |
with open(temp_filepath, "wb") as f: # μμ νμΌμ λ°μ΄λ리 μ°κΈ° λͺ¨λλ‘ μ½λλ€.
|
53 |
f.write(json_docs.getvalue())
|
54 |
-
json_loader = JSONLoader(
|
|
|
|
|
|
|
|
|
55 |
json_doc = json_loader.load()
|
56 |
return json_doc
|
57 |
|
|
|
33 |
temp_filepath = os.path.join(temp_dir.name, text_docs.name) # μμ νμΌ κ²½λ‘λ₯Ό μμ±ν©λλ€.
|
34 |
with open(temp_filepath, "wb") as f: # μμ νμΌμ λ°μ΄λ리 μ°κΈ° λͺ¨λλ‘ μ½λλ€.
|
35 |
f.write(text_docs.getvalue())
|
36 |
+
text_loader = TextLoader(temp_filepath)
|
37 |
text_doc = text_loader.load()
|
38 |
return text_doc
|
39 |
|
|
|
51 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name) # μμ νμΌ κ²½λ‘λ₯Ό μμ±ν©λλ€.
|
52 |
with open(temp_filepath, "wb") as f: # μμ νμΌμ λ°μ΄λ리 μ°κΈ° λͺ¨λλ‘ μ½λλ€.
|
53 |
f.write(json_docs.getvalue())
|
54 |
+
json_loader = JSONLoader(
|
55 |
+
file_path='./example_data/facebook_chat.json',
|
56 |
+
jq_schema='.messages[].content',
|
57 |
+
text_content=False)
|
58 |
+
data = loader.load()
|
59 |
json_doc = json_loader.load()
|
60 |
return json_doc
|
61 |
|