Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,14 +27,16 @@ def inference(input_doc):
|
|
27 |
max_prob_class = max(results, key=results.get)
|
28 |
max_prob = results[max_prob_class]
|
29 |
# Display results
|
30 |
-
|
31 |
-
for class_name, prob in results.items():
|
32 |
-
print(f"{class_name}: {prob:.2%}")
|
33 |
|
34 |
# Set up the Streamlit interface
|
35 |
-
st.title('κ°μ λΆμ(Sentiment Analysis)
|
|
|
36 |
user_input = st.text_area("μ΄ κ³³μ κΈ μ
λ ₯(100μ μ΄ν κΆμ₯):")
|
37 |
if st.button('μμ'):
|
38 |
result = inference(user_input)
|
39 |
-
st.write(result)
|
|
|
40 |
|
|
|
27 |
max_prob_class = max(results, key=results.get)
|
28 |
max_prob = results[max_prob_class]
|
29 |
# Display results
|
30 |
+
return [results, f"κ°μ₯ κ°νκ² λνλ κ°μ : {max_prob_class}"]
|
31 |
+
''' for class_name, prob in results.items():
|
32 |
+
print(f"{class_name}: {prob:.2%}")'''
|
33 |
|
34 |
# Set up the Streamlit interface
|
35 |
+
st.title('κ°μ λΆμ(Sentiment Analysis)')
|
36 |
+
st.markdown('<small style="color:grey;">κΈμ λνλ 곡ν¬, λλ, λΆλ
Έ, μ¬ν, μ€λ¦½, ν볡, νμ€μ μ λλ₯Ό λΉμ¨λ‘ μλ €λ립λλ€.</small>', unsafe_allow_html=True)
|
37 |
user_input = st.text_area("μ΄ κ³³μ κΈ μ
λ ₯(100μ μ΄ν κΆμ₯):")
|
38 |
if st.button('μμ'):
|
39 |
result = inference(user_input)
|
40 |
+
st.write(result[0])
|
41 |
+
st.write(result[1])
|
42 |
|