Spaces:
Sleeping
Sleeping
fix xstick error
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ uploaded_file = st.file_uploader("Upload JSON File", type=["json"])
|
|
| 15 |
if uploaded_file:
|
| 16 |
loaded_dict = json.load(uploaded_file)
|
| 17 |
df = pd.DataFrame(loaded_dict)
|
| 18 |
-
st.subheader(len(df)
|
| 19 |
st.write(df)
|
| 20 |
|
| 21 |
# Sentiment Distribution Chart
|
|
@@ -30,12 +30,11 @@ if uploaded_file:
|
|
| 30 |
ax1.set_title("Sentiment Distribution %")
|
| 31 |
|
| 32 |
# sns.countplot(x="S", data=df, palette=palette_color, ax=ax2)
|
| 33 |
-
|
| 34 |
ax2.set_title("Sentiment Distribution Counts")
|
| 35 |
ax2.bar(sentiment_distribution.index, sentiment_distribution.values, color=palette_color)
|
| 36 |
# ax2.xlabel("Sentiment")
|
| 37 |
# ax2.ylabel("Times")
|
| 38 |
-
ax2.xticks(rotation=0) # Rotate x-axis labels if needed
|
| 39 |
st.pyplot(fig)
|
| 40 |
|
| 41 |
# Group by and aggregate data
|
|
|
|
| 15 |
if uploaded_file:
|
| 16 |
loaded_dict = json.load(uploaded_file)
|
| 17 |
df = pd.DataFrame(loaded_dict)
|
| 18 |
+
st.subheader(len(df)+" sentiment tuples was detected")
|
| 19 |
st.write(df)
|
| 20 |
|
| 21 |
# Sentiment Distribution Chart
|
|
|
|
| 30 |
ax1.set_title("Sentiment Distribution %")
|
| 31 |
|
| 32 |
# sns.countplot(x="S", data=df, palette=palette_color, ax=ax2)
|
|
|
|
| 33 |
ax2.set_title("Sentiment Distribution Counts")
|
| 34 |
ax2.bar(sentiment_distribution.index, sentiment_distribution.values, color=palette_color)
|
| 35 |
# ax2.xlabel("Sentiment")
|
| 36 |
# ax2.ylabel("Times")
|
| 37 |
+
# ax2.xticks(rotation=0) # Rotate x-axis labels if needed
|
| 38 |
st.pyplot(fig)
|
| 39 |
|
| 40 |
# Group by and aggregate data
|