Spaces:
Runtime error
Runtime error
binliu
commited on
Commit
·
8a453ae
1
Parent(s):
2a0a140
comment
Browse files
app.py
CHANGED
|
@@ -48,9 +48,9 @@ def main():
|
|
| 48 |
labels = ["positive", "negative" ,"neutral"]
|
| 49 |
pd_image_input = {'emotion':labels,'value':value}
|
| 50 |
df_image = pd.DataFrame(pd_image_input, columns=['emotion', 'value'])
|
| 51 |
-
# seaborn调色板
|
| 52 |
pal_ = list(sns.color_palette(palette='plasma_r',n_colors=len(labels)).as_hex())
|
| 53 |
-
#
|
| 54 |
fig = plt.figure(figsize=(10, 10))
|
| 55 |
plt.rcParams.update({'font.size': 16})
|
| 56 |
plt.pie(df_image.value,
|
|
@@ -59,6 +59,7 @@ def main():
|
|
| 59 |
pctdistance=0.9)
|
| 60 |
plt.legend(bbox_to_anchor=(1, 1), loc=2, frameon=False)
|
| 61 |
st.pyplot(fig)
|
|
|
|
| 62 |
st.write(summary)
|
| 63 |
if __name__ == '__main__':
|
| 64 |
load_dotenv()
|
|
|
|
| 48 |
labels = ["positive", "negative" ,"neutral"]
|
| 49 |
pd_image_input = {'emotion':labels,'value':value}
|
| 50 |
df_image = pd.DataFrame(pd_image_input, columns=['emotion', 'value'])
|
| 51 |
+
# seaborn 调色板
|
| 52 |
pal_ = list(sns.color_palette(palette='plasma_r',n_colors=len(labels)).as_hex())
|
| 53 |
+
# 饼图
|
| 54 |
fig = plt.figure(figsize=(10, 10))
|
| 55 |
plt.rcParams.update({'font.size': 16})
|
| 56 |
plt.pie(df_image.value,
|
|
|
|
| 59 |
pctdistance=0.9)
|
| 60 |
plt.legend(bbox_to_anchor=(1, 1), loc=2, frameon=False)
|
| 61 |
st.pyplot(fig)
|
| 62 |
+
# 增加总结信息
|
| 63 |
st.write(summary)
|
| 64 |
if __name__ == '__main__':
|
| 65 |
load_dotenv()
|