jonghhhh commited on
Commit
af999d7
β€’
1 Parent(s): 0f15b6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
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
- print(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
  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