Spaces:
Runtime error
Runtime error
shubh2014shiv
commited on
Commit
β’
d7dc650
1
Parent(s):
74d0a3b
Update app.py
Browse files
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 |
|