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