vickeee465 commited on
Commit
467c2e7
·
1 Parent(s): 46a7d7d

custom colormap because the previous one is annoying

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -8,6 +8,7 @@ from transformers import AutoModelForSequenceClassification
8
  from transformers import AutoTokenizer
9
  import gradio as gr
10
  import matplotlib.pyplot as plt
 
11
  import plotly.express as px
12
  import seaborn as sns
13
 
@@ -90,11 +91,13 @@ def prepare_heatmap_data(data):
90
  return heatmap_data
91
 
92
 
93
- def plot_emotion_heatmap(heatmap_data, cmap="Greys_r"):
94
  heatmap_data = heatmap_data.T
95
 
96
  fig = plt.figure(figsize=(len(heatmap_data.columns) * 0.5 + 4, len(heatmap_data.index) * 0.5 + 2))
97
 
 
 
98
  sns.heatmap(
99
  heatmap_data,
100
  annot=False,
 
8
  from transformers import AutoTokenizer
9
  import gradio as gr
10
  import matplotlib.pyplot as plt
11
+ from matplotlib.colors import LinearSegmentedColormap
12
  import plotly.express as px
13
  import seaborn as sns
14
 
 
91
  return heatmap_data
92
 
93
 
94
+ def plot_emotion_heatmap(heatmap_data):
95
  heatmap_data = heatmap_data.T
96
 
97
  fig = plt.figure(figsize=(len(heatmap_data.columns) * 0.5 + 4, len(heatmap_data.index) * 0.5 + 2))
98
 
99
+ cmap = LinearSegmentedColormap.from_list("white_to_grey", ["#ffffff", "#aaaaaa"])
100
+
101
  sns.heatmap(
102
  heatmap_data,
103
  annot=False,