shilpabanerjee commited on
Commit
4d8b833
·
1 Parent(s): 8066095

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -47,6 +47,14 @@ if file_path is not None:
47
  st.write(f"Sentiment Score: {score:.2f}")
48
  st.write("---")
49
 
 
 
 
 
 
 
 
 
50
  except pd.errors.EmptyDataError:
51
  st.error("Error: The uploaded CSV file is empty.")
52
  except pd.errors.ParserError:
 
47
  st.write(f"Sentiment Score: {score:.2f}")
48
  st.write("---")
49
 
50
+ # Create sentiment distribution graph
51
+ sentiment_scores = [score for _, score in sorted_tweets_scores]
52
+ plt.hist(sentiment_scores, bins=10, edgecolor='black')
53
+ plt.xlabel('Sentiment Score')
54
+ plt.ylabel('Frequency')
55
+ plt.title('Sentiment Distribution')
56
+ st.pyplot(plt)
57
+
58
  except pd.errors.EmptyDataError:
59
  st.error("Error: The uploaded CSV file is empty.")
60
  except pd.errors.ParserError: