xtlyxt commited on
Commit
798ae3d
·
verified ·
1 Parent(s): 5f7417c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -4,6 +4,7 @@ from transformers import pipeline
4
  import pandas as pd
5
  import matplotlib.pyplot as plt
6
  import seaborn as sns
 
7
 
8
  # Initialize session state for results, image names, and image sizes if not already present
9
  if 'results' not in st.session_state:
@@ -103,6 +104,16 @@ if st.button("Generate DataFrame"):
103
  plt.ylabel('Data Points')
104
  st.pyplot(plt)
105
 
 
 
 
 
 
 
 
 
 
 
106
  # Optional: Save the DataFrame to a CSV file
107
  df_emotions.to_csv('emotion_scores.csv', index=False)
108
  st.success('DataFrame generated and saved as emotion_scores.csv')
 
4
  import pandas as pd
5
  import matplotlib.pyplot as plt
6
  import seaborn as sns
7
+ from pandas.plotting import parallel_coordinates
8
 
9
  # Initialize session state for results, image names, and image sizes if not already present
10
  if 'results' not in st.session_state:
 
104
  plt.ylabel('Data Points')
105
  st.pyplot(plt)
106
 
107
+
108
+
109
+ # Plotting the parallel coordinates plot
110
+ plt.figure(figsize=(12, 6))
111
+ parallel_coordinates(df_normalized, class_column=df_normalized.columns[-1], colormap=plt.get_cmap("Set2"))
112
+ plt.title('Parallel Coordinates Plot for Emotions')
113
+ plt.xlabel('Emotion Categories')
114
+ plt.ylabel('Normalized Scores')
115
+ st.pyplot(plt)
116
+
117
  # Optional: Save the DataFrame to a CSV file
118
  df_emotions.to_csv('emotion_scores.csv', index=False)
119
  st.success('DataFrame generated and saved as emotion_scores.csv')