Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -79,7 +79,6 @@ def predict_emotion(text, top_k=5):
|
|
79 |
|
80 |
tabs = st.tabs(["๊ฐ์ ๋ถ์ ์ฒดํ", "AI๋ ์ด๋ป๊ฒ ๊ฐ์ ์ ์ดํดํ ๊น?", "Few-shot Fine-tuning์ด๋?", "ํ์ฉ๊ณผ ์์"])
|
81 |
|
82 |
-
|
83 |
with tabs[0]:
|
84 |
st.markdown('<div class="big-title">๐ญ ํ๊ตญ์ด ๊ฐ์ ๋ถ์ AI ์ฒดํ</div>', unsafe_allow_html=True)
|
85 |
st.markdown('<div class="sub-info">2025๋
1ํ๊ธฐ ๋์งํธ ์ธ๋ฌธํ ์
๋ฌธ (SLA23501) ยท <b>Team ์๋ฌ๋๋ณผ</b><br>๊ฐ์ํ ยท ๊น๋์ฐ ยท ์ ์์ ยท ์ ํ์ฑ ยท ์ต์ข
์ค</div>', unsafe_allow_html=True)
|
@@ -91,19 +90,18 @@ with tabs[0]:
|
|
91 |
</div>
|
92 |
""", unsafe_allow_html=True)
|
93 |
|
94 |
-
if "
|
95 |
-
st.session_state.
|
96 |
-
|
97 |
-
st.text_area("โ๏ธ ๋ฌธ์ฅ์ ์
๋ ฅํ์ธ์:", key="example_text", height=120, placeholder="์: ์ค๋ ํ๋ฃจ ์ ๋ง ํ๋ณตํ์ด์.")
|
98 |
|
99 |
col1, col2 = st.columns([1, 1])
|
100 |
with col1:
|
101 |
if st.button("๐ ์์ ๋ฌธ์ฅ ๋ถ๋ฌ์ค๊ธฐ"):
|
102 |
-
st.session_state.
|
|
|
|
|
103 |
|
104 |
with col2:
|
105 |
if st.button("๐ ๊ฐ์ ์์ธกํ๊ธฐ"):
|
106 |
-
text = st.session_state.example_text
|
107 |
if text.strip():
|
108 |
results, full_probs = predict_emotion(text)
|
109 |
st.subheader("๐ ์์ ๊ฐ์ ๊ฒฐ๊ณผ")
|
@@ -114,6 +112,10 @@ with tabs[0]:
|
|
114 |
else:
|
115 |
st.warning("๋ฌธ์ฅ์ ๋จผ์ ์
๋ ฅํด์ฃผ์ธ์.")
|
116 |
|
|
|
|
|
|
|
|
|
117 |
|
118 |
|
119 |
|
|
|
79 |
|
80 |
tabs = st.tabs(["๊ฐ์ ๋ถ์ ์ฒดํ", "AI๋ ์ด๋ป๊ฒ ๊ฐ์ ์ ์ดํดํ ๊น?", "Few-shot Fine-tuning์ด๋?", "ํ์ฉ๊ณผ ์์"])
|
81 |
|
|
|
82 |
with tabs[0]:
|
83 |
st.markdown('<div class="big-title">๐ญ ํ๊ตญ์ด ๊ฐ์ ๋ถ์ AI ์ฒดํ</div>', unsafe_allow_html=True)
|
84 |
st.markdown('<div class="sub-info">2025๋
1ํ๊ธฐ ๋์งํธ ์ธ๋ฌธํ ์
๋ฌธ (SLA23501) ยท <b>Team ์๋ฌ๋๋ณผ</b><br>๊ฐ์ํ ยท ๊น๋์ฐ ยท ์ ์์ ยท ์ ํ์ฑ ยท ์ต์ข
์ค</div>', unsafe_allow_html=True)
|
|
|
90 |
</div>
|
91 |
""", unsafe_allow_html=True)
|
92 |
|
93 |
+
if "text_input" not in st.session_state:
|
94 |
+
st.session_state.text_input = ""
|
|
|
|
|
95 |
|
96 |
col1, col2 = st.columns([1, 1])
|
97 |
with col1:
|
98 |
if st.button("๐ ์์ ๋ฌธ์ฅ ๋ถ๋ฌ์ค๊ธฐ"):
|
99 |
+
st.session_state.text_input = "์ด ์ํ ์ ๋ง ๊ฐ๋์ ์ด์์ด์. ๋๋ฌผ์ด ๋ฌ์ต๋๋ค."
|
100 |
+
|
101 |
+
text = st.text_area("โ๏ธ ๋ฌธ์ฅ์ ์
๋ ฅํ์ธ์:", value=st.session_state.text_input, height=120, placeholder="์: ์ค๋ ํ๋ฃจ ์ ๋ง ํ๋ณตํ์ด์.")
|
102 |
|
103 |
with col2:
|
104 |
if st.button("๐ ๊ฐ์ ์์ธกํ๊ธฐ"):
|
|
|
105 |
if text.strip():
|
106 |
results, full_probs = predict_emotion(text)
|
107 |
st.subheader("๐ ์์ ๊ฐ์ ๊ฒฐ๊ณผ")
|
|
|
112 |
else:
|
113 |
st.warning("๋ฌธ์ฅ์ ๋จผ์ ์
๋ ฅํด์ฃผ์ธ์.")
|
114 |
|
115 |
+
# ์ต์ text ์ ์ง
|
116 |
+
st.session_state.text_input = text
|
117 |
+
|
118 |
+
|
119 |
|
120 |
|
121 |
|