Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	
		vickeee465
		
	commited on
		
		
					Commit 
							
							·
						
						88a65ea
	
1
								Parent(s):
							
							193599e
								
making it simpler
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -105,11 +105,9 @@ def plot_emotion_barplot(heatmap_data): 
     | 
|
| 105 | 
         
             
                emotion_frequencies = (emotion_counts.reindex(all_emotions, fill_value=0) / emotion_counts.sum()).sort_values(ascending=False)
         
     | 
| 106 | 
         
             
                fig, ax = plt.subplots(figsize=(8, 6))
         
     | 
| 107 | 
         
             
                sns.barplot(x=emotion_frequencies.values, y=emotion_frequencies.index, palette="coolwarm", ax=ax)
         
     | 
| 108 | 
         
            -
                ax.set_title("Relative Frequencies of  
     | 
| 109 | 
         
             
                ax.set_xlabel("Relative Frequency")
         
     | 
| 110 | 
         
             
                ax.set_ylabel("Emotions")
         
     | 
| 111 | 
         
            -
                for i, value in enumerate(emotion_frequencies.values):
         
     | 
| 112 | 
         
            -
                    ax.text(value + 0.01, i, f"{value:.2f}", va='center')
         
     | 
| 113 | 
         
             
                plt.tight_layout()
         
     | 
| 114 | 
         
             
                return fig
         
     | 
| 115 | 
         | 
| 
         | 
|
| 105 | 
         
             
                emotion_frequencies = (emotion_counts.reindex(all_emotions, fill_value=0) / emotion_counts.sum()).sort_values(ascending=False)
         
     | 
| 106 | 
         
             
                fig, ax = plt.subplots(figsize=(8, 6))
         
     | 
| 107 | 
         
             
                sns.barplot(x=emotion_frequencies.values, y=emotion_frequencies.index, palette="coolwarm", ax=ax)
         
     | 
| 108 | 
         
            +
                ax.set_title("Relative Frequencies of Predicted Emotions")
         
     | 
| 109 | 
         
             
                ax.set_xlabel("Relative Frequency")
         
     | 
| 110 | 
         
             
                ax.set_ylabel("Emotions")
         
     | 
| 
         | 
|
| 
         | 
|
| 111 | 
         
             
                plt.tight_layout()
         
     | 
| 112 | 
         
             
                return fig
         
     | 
| 113 | 
         |