shubh2014shiv commited on
Commit
d7dc650
β€’
1 Parent(s): 74d0a3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -158,15 +158,15 @@ 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)
172
 
 
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)
172