Spaces:
Runtime error
Runtime error
add charts
Browse files- .ipynb_checkpoints/app-checkpoint.py +4 -6
- app.py +4 -6
.ipynb_checkpoints/app-checkpoint.py
CHANGED
|
@@ -14,8 +14,7 @@ if st.button('Click for predictions!'):
|
|
| 14 |
topics_prob, sentiment_prob = get_single_prediction(feedback)
|
| 15 |
|
| 16 |
bar = px.bar(topics_prob, x='probability', y='topic')
|
| 17 |
-
|
| 18 |
-
|
| 19 |
pie = px.pie(sentiment_prob,
|
| 20 |
values='probability',
|
| 21 |
names='sentiment',
|
|
@@ -25,10 +24,9 @@ if st.button('Click for predictions!'):
|
|
| 25 |
},
|
| 26 |
color='sentiment'
|
| 27 |
)
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
#st.success(f'Your text has been predicted to fall under the following topics: {result[:-1]}. The sentiment of this text is {result[-1]}.')
|
| 32 |
|
| 33 |
st.write("\n")
|
| 34 |
st.subheader('Or... Upload a csv file if you have a file instead.')
|
|
|
|
| 14 |
topics_prob, sentiment_prob = get_single_prediction(feedback)
|
| 15 |
|
| 16 |
bar = px.bar(topics_prob, x='probability', y='topic')
|
| 17 |
+
|
|
|
|
| 18 |
pie = px.pie(sentiment_prob,
|
| 19 |
values='probability',
|
| 20 |
names='sentiment',
|
|
|
|
| 24 |
},
|
| 25 |
color='sentiment'
|
| 26 |
)
|
| 27 |
+
st.plotly_chart(bar, use_container_width=True)
|
| 28 |
+
st.plotly_chart(pie, use_container_width=True)
|
| 29 |
+
|
|
|
|
| 30 |
|
| 31 |
st.write("\n")
|
| 32 |
st.subheader('Or... Upload a csv file if you have a file instead.')
|
app.py
CHANGED
|
@@ -14,8 +14,7 @@ if st.button('Click for predictions!'):
|
|
| 14 |
topics_prob, sentiment_prob = get_single_prediction(feedback)
|
| 15 |
|
| 16 |
bar = px.bar(topics_prob, x='probability', y='topic')
|
| 17 |
-
|
| 18 |
-
|
| 19 |
pie = px.pie(sentiment_prob,
|
| 20 |
values='probability',
|
| 21 |
names='sentiment',
|
|
@@ -25,10 +24,9 @@ if st.button('Click for predictions!'):
|
|
| 25 |
},
|
| 26 |
color='sentiment'
|
| 27 |
)
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
#st.success(f'Your text has been predicted to fall under the following topics: {result[:-1]}. The sentiment of this text is {result[-1]}.')
|
| 32 |
|
| 33 |
st.write("\n")
|
| 34 |
st.subheader('Or... Upload a csv file if you have a file instead.')
|
|
|
|
| 14 |
topics_prob, sentiment_prob = get_single_prediction(feedback)
|
| 15 |
|
| 16 |
bar = px.bar(topics_prob, x='probability', y='topic')
|
| 17 |
+
|
|
|
|
| 18 |
pie = px.pie(sentiment_prob,
|
| 19 |
values='probability',
|
| 20 |
names='sentiment',
|
|
|
|
| 24 |
},
|
| 25 |
color='sentiment'
|
| 26 |
)
|
| 27 |
+
st.plotly_chart(bar, use_container_width=True)
|
| 28 |
+
st.plotly_chart(pie, use_container_width=True)
|
| 29 |
+
|
|
|
|
| 30 |
|
| 31 |
st.write("\n")
|
| 32 |
st.subheader('Or... Upload a csv file if you have a file instead.')
|