Step 13: Visualize the Distribution of Sentiment Scores
We can use a histogram to visualize the distribution of sentiment scores.
import matplotlib.pyplot as plt
# Plot a histogram of the sentiment scores
plt.figure(figsize=(8, 6))
plt.hist(df['sentiment_score'], bins=20, color='skyblue')
plt.title('Distribution of Sentiment Scores')
plt.xlabel('Sentiment Score')
plt.ylabel('Frequency')
plt.show()