Update app.py
Browse files
app.py
CHANGED
@@ -130,8 +130,8 @@ if st.button("Sentiment Analysis", type="secondary"):
|
|
130 |
results = []
|
131 |
for i, label in enumerate(predicted_labels):
|
132 |
results.append({'Review Number': i + 1, 'Sentiment': model.config.id2label[label.item()]})
|
133 |
-
|
134 |
-
|
135 |
|
136 |
|
137 |
|
@@ -155,7 +155,9 @@ if st.button("Sentiment Analysis", type="secondary"):
|
|
155 |
plt.imshow(wc)
|
156 |
plt.axis('off')
|
157 |
st.pyplot(fig)
|
158 |
-
|
|
|
|
|
159 |
st.download_button(
|
160 |
label="Download data as CSV",
|
161 |
data=csv,
|
|
|
130 |
results = []
|
131 |
for i, label in enumerate(predicted_labels):
|
132 |
results.append({'Review Number': i + 1, 'Sentiment': model.config.id2label[label.item()]})
|
133 |
+
sentiment_df = pd.DataFrame(results)
|
134 |
+
|
135 |
|
136 |
|
137 |
|
|
|
155 |
plt.imshow(wc)
|
156 |
plt.axis('off')
|
157 |
st.pyplot(fig)
|
158 |
+
|
159 |
+
result1 = result.drop(result.columns[['Review Number']], axis=1)
|
160 |
+
csv = result1.to_csv(index=False)
|
161 |
st.download_button(
|
162 |
label="Download data as CSV",
|
163 |
data=csv,
|