Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -50,6 +50,32 @@ st.write("GPT๋ ์ค์ ํ ์ ์์ต๋๋ค. ์ํ๋ ๊ฒฐ๊ณผ๊ฐ ๋์ค์ง ์
|
|
50 |
# ํ์ผ ์
๋ก๋ ๊ธฐ๋ฅ
|
51 |
uploaded_data = upload_and_process_file()
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
# ์ปฌ๋ผ ์์ฑ
|
54 |
col1, col2 = st.columns(2)
|
55 |
|
@@ -64,22 +90,16 @@ with col1:
|
|
64 |
with col2:
|
65 |
# ํค์๋ ์ ํ ์ต์
|
66 |
st.write("ํค์๋ ์ ํ")
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
|
71 |
# ๋ฐ์ดํฐ ์ฒ๋ฆฌ ๋ฐ ๊ฒฐ๊ณผ ์ถ๋ ฅ
|
72 |
if st.button("์์ฑ"):
|
73 |
with st.spinner('์์ฑ์ค...'):
|
74 |
input_data = "\n".join([st.session_state[f'record_{i}'] for i in range(5) if st.session_state[f'record_{i}']])
|
75 |
-
#
|
76 |
-
keyword_data = ""
|
77 |
-
if attitudes:
|
78 |
-
keyword_data += "ํ์ตํ๋ "
|
79 |
-
if relationships:
|
80 |
-
keyword_data += "๊ต์ฐ๊ด๊ณ "
|
81 |
-
if personality:
|
82 |
-
keyword_data += "์ฑ๊ฒฉ "
|
83 |
full_data = input_data + "\n" + keyword_data
|
84 |
generated_record = generate_living_record(full_data)
|
85 |
st.write("์์ฑ๋ ์ํ๊ธฐ๋ก๋ถ:", generated_record)
|
|
|
50 |
# ํ์ผ ์
๋ก๋ ๊ธฐ๋ฅ
|
51 |
uploaded_data = upload_and_process_file()
|
52 |
|
53 |
+
#์์ ํค์๋
|
54 |
+
attitude_keywords = [
|
55 |
+
"์ง์ค๋ ฅ", "๊ณผ์ ์ดํด", "๋ฐํ", "๋ฌธ์ ํด๊ฒฐ๋ ฅ", "๊ณผ์ ์ํ", "๊ด์ฐฐ๋ ฅ",
|
56 |
+
"ํ๊ตฌ๋ ฅ", "์๊ธฐ ์๊ฐ ํํ", "๋
ผ๋ฆฌ์ ์ฌ๊ณ ๋ ฅ", "์ด๋์ ๊ฒฝ", "ํ๋์ฌ",
|
57 |
+
"๋ฆฌ๋์ฝ", "๋
ผ๋ฆฌ์ ๋นํ๋ ฅ", "๊ต๊ณผ ํ์ต ์ฑ์ทจ๋", "๋ชฉํ์์", "๊ธฐ๋ณธ ํ์ต",
|
58 |
+
"๋์ ๊ณผ์ ", "๋ฏธ์ ๊ฐ๊ฐ", "์์ ์ ์ฌ๋ฅ", "์์
์ ์ฌ๋ฅ", "ํธ๊ธฐ์ฌ",
|
59 |
+
"์ง๋ฌธ", "๋ชจ๋ ํ๋"
|
60 |
+
|
61 |
+
]
|
62 |
+
relationship_keywords = [
|
63 |
+
"ํ๋์ฑ", "์น์ ํจ", "๊ณต๊ฐ ๋ฅ๋ ฅ", "์ปค๋ฎค๋์ผ์ด์
", "๋ฆฌ๋์ญ", "๊ฒฝ์", "ํ๋ ฅ",
|
64 |
+
"์ธ์ ์๊ตฌ", "์์ฌ์ํต ๋ฌธ์ ", "์ ๋ขฐ", "์ํธ์กด์ค", "๊ณต์ ", "์ดํด์ฌ", "์น๋ฐํจ",
|
65 |
+
"์ง์งํจ", "๋์", "๋ฐฐ๋ ค", "๊ฑฐ๋ถ", "๋น๋ฐ", "์๊ธฐ์ค์ฌ์ ", "์ธ๋ก์", "๋น๋",
|
66 |
+
"๋ฌด๊ด์ฌ", "์งํฌ", "๊ฐ๋ฑ", "๊ต๋ฅ ํ๋ฐํจ", "์ํต ์ํจ", "๋ค์ ํจ"
|
67 |
+
]
|
68 |
+
|
69 |
+
personality_keywords = [
|
70 |
+
"์์ ๊ฐ", "์ฑ
์๊ฐ", "ํฌ์ฉ๋ ฅ", "๊ธ์ ์ ํ๋", "์ ์ฐ์ฑ",
|
71 |
+
"๊ฐ์์ฑ", "์๋ฏผํจ", "ํ๋ฐํจ", "์ฐจ๋ถํจ", "์ ๊ทน์ ",
|
72 |
+
"์๊ทน์ ", "์์ค์", "๊ฒธ์ํจ", "์์ ๊ฐ", "์์์ ",
|
73 |
+
"๋ฌด๊ธฐ๋ ฅ", "์ฑ์ค", "์ฌ์ธํจ", "์ฐ๋งํจ", "์กฐ๊ธํจ",
|
74 |
+
"๊ฑฐ์น ๋ค", "๊ธ์ ์ ", "์น์ ํจ", "๋ถ๋
ธ", "์ธ๋ด์ฌ",
|
75 |
+
"๋
๋ฆฝ์ ", "์์ฒ", "์จํํจ", "๋ฐ๋ปํจ", "๋ฏธ์",
|
76 |
+
"์ฌ์น", "์ ๋จธ", "์ต์ธํจ", "์ฐ์ธํจ", "๋ถ์ ์ "
|
77 |
+
]
|
78 |
+
|
79 |
# ์ปฌ๋ผ ์์ฑ
|
80 |
col1, col2 = st.columns(2)
|
81 |
|
|
|
90 |
with col2:
|
91 |
# ํค์๋ ์ ํ ์ต์
|
92 |
st.write("ํค์๋ ์ ํ")
|
93 |
+
selected_attitude = st.multiselect("ํ์ตํ๋", attitude_keywords)
|
94 |
+
selected_relationship = st.multiselect("๊ต์ฐ๊ด๊ณ", relationship_keywords)
|
95 |
+
selected_personality = st.multiselect("์ฑ๊ฒฉ", personality_keywords)
|
96 |
|
97 |
# ๋ฐ์ดํฐ ์ฒ๋ฆฌ ๋ฐ ๊ฒฐ๊ณผ ์ถ๋ ฅ
|
98 |
if st.button("์์ฑ"):
|
99 |
with st.spinner('์์ฑ์ค...'):
|
100 |
input_data = "\n".join([st.session_state[f'record_{i}'] for i in range(5) if st.session_state[f'record_{i}']])
|
101 |
+
# ํค์๋๋ฅผ ์
๋ ฅ ๋ฐ์ดํฐ์ ์ถ๊ฐ
|
102 |
+
keyword_data = " ".join(selected_attitude + selected_relationship + selected_personality)
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
full_data = input_data + "\n" + keyword_data
|
104 |
generated_record = generate_living_record(full_data)
|
105 |
st.write("์์ฑ๋ ์ํ๊ธฐ๋ก๋ถ:", generated_record)
|