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