shubh2014shiv commited on
Commit
de2567e
โ€ข
1 Parent(s): d7dc650

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -158,14 +158,14 @@ if topic == "Sentiment Analysis":
158
  logits = logits.detach().cpu().numpy()
159
  scores = 1 / (1 + np.exp(-1 * logits))
160
 
161
- result = {"TEXT": jp_review_text,'NEGATIVE (ใƒใ‚ฌใƒ†ใ‚ฃใƒ–)': scores[0][0], 'POSITIVE (ใƒใ‚ธใƒ†ใ‚ฃใƒ–)': scores[0][1]}
162
 
163
  result_col,graph_col = st.columns(2)
164
  with result_col:
165
  st.write(result)
166
  with graph_col:
167
  fig = px.bar(x=['NEGATIVE (ใƒใ‚ฌใƒ†ใ‚ฃใƒ–)','POSITIVE (ใƒใ‚ธใƒ†ใ‚ฃใƒ–)'],y=[result['NEGATIVE (ใƒใ‚ฌใƒ†ใ‚ฃใƒ–)'],result['POSITIVE (ใƒใ‚ธใƒ†ใ‚ฃใƒ–)']])
168
- fig.update_layout(title="Probability distribution of Sentiment for the given text",\
169
  yaxis_title="Probability (็ขบ็Ž‡)")
170
  fig.update_traces(marker_color=['#FF7F7F','#32CD32'])
171
  st.plotly_chart(fig)
 
158
  logits = logits.detach().cpu().numpy()
159
  scores = 1 / (1 + np.exp(-1 * logits))
160
 
161
+ result = {"TEXT (ๆ–‡็ซ )": jp_review_text,'NEGATIVE (ใƒใ‚ฌใƒ†ใ‚ฃใƒ–)': scores[0][0], 'POSITIVE (ใƒใ‚ธใƒ†ใ‚ฃใƒ–)': scores[0][1]}
162
 
163
  result_col,graph_col = st.columns(2)
164
  with result_col:
165
  st.write(result)
166
  with graph_col:
167
  fig = px.bar(x=['NEGATIVE (ใƒใ‚ฌใƒ†ใ‚ฃใƒ–)','POSITIVE (ใƒใ‚ธใƒ†ใ‚ฃใƒ–)'],y=[result['NEGATIVE (ใƒใ‚ฌใƒ†ใ‚ฃใƒ–)'],result['POSITIVE (ใƒใ‚ธใƒ†ใ‚ฃใƒ–)']])
168
+ fig.update_layout(title="Probability distribution of Sentiment for the given text\n(ไธŽใˆใ‚‰ใ‚ŒใŸใƒ†ใ‚ญใ‚นใƒˆใซๅฏพใ™ใ‚‹ๆ„Ÿๆƒ…ใฎ็ขบ็Ž‡ๅˆ†ๅธƒ)",\
169
  yaxis_title="Probability (็ขบ็Ž‡)")
170
  fig.update_traces(marker_color=['#FF7F7F','#32CD32'])
171
  st.plotly_chart(fig)