Spaces:
Build error
Build error
Update utils.py
Browse files
utils.py
CHANGED
@@ -49,8 +49,7 @@ thresholds = {"joy": 0.99,"anger": 0.95,"surprise": 0.95,"sadness": 0.98,"fear":
|
|
49 |
|
50 |
color_map = {"joy": "green","anger": "red","surprise": "yellow","sadness": "blue","fear": "orange","love": "purple",}
|
51 |
|
52 |
-
def create_fig(x_min, x_max, plot_sentences):
|
53 |
-
to_plot = []
|
54 |
x, y = list(zip(*to_plot))
|
55 |
|
56 |
plot_df = pd.DataFrame(
|
@@ -96,6 +95,7 @@ def sentiment(diarized, emotion_pipeline):
|
|
96 |
|
97 |
customer_sentiments = []
|
98 |
plot_sentences = []
|
|
|
99 |
|
100 |
# used to set the x range of ticks on the plot
|
101 |
x_min = 100
|
@@ -136,7 +136,7 @@ def sentiment(diarized, emotion_pipeline):
|
|
136 |
x_min -= 5
|
137 |
x_max += 5
|
138 |
|
139 |
-
fig = create_fig(x_min, x_max, plot_sentences)
|
140 |
|
141 |
return customer_sentiments, fig
|
142 |
|
|
|
49 |
|
50 |
color_map = {"joy": "green","anger": "red","surprise": "yellow","sadness": "blue","fear": "orange","love": "purple",}
|
51 |
|
52 |
+
def create_fig(x_min, x_max, to_plot, plot_sentences):
|
|
|
53 |
x, y = list(zip(*to_plot))
|
54 |
|
55 |
plot_df = pd.DataFrame(
|
|
|
95 |
|
96 |
customer_sentiments = []
|
97 |
plot_sentences = []
|
98 |
+
to_plot = []
|
99 |
|
100 |
# used to set the x range of ticks on the plot
|
101 |
x_min = 100
|
|
|
136 |
x_min -= 5
|
137 |
x_max += 5
|
138 |
|
139 |
+
fig = create_fig(x_min, x_max, to_plot, plot_sentences)
|
140 |
|
141 |
return customer_sentiments, fig
|
142 |
|