jpdiazpardo commited on
Commit
325a38f
1 Parent(s): c965291

Delete charts.py

Browse files
Files changed (1) hide show
  1. charts.py +0 -34
charts.py DELETED
@@ -1,34 +0,0 @@
1
- import plotly.graph_objects as go
2
-
3
- def add_emoji(emotions_list):
4
- for s in range(len(emotions_list)):
5
- if emotions_list[s]=="surprise": emotions_list[s]="surprise 😲"
6
- elif emotions_list[s]=="joy": emotions_list[s]="joy 😀"
7
- elif emotions_list[s]=="anger": emotions_list[s]="anger 🤬"
8
- elif emotions_list[s]=="neutral": emotions_list[s]="neutral 😐"
9
- elif emotions_list[s]=="disgust": emotions_list[s]="disgust 🤢"
10
- elif emotions_list[s]=="fear": emotions_list[s]="fear 😨"
11
- elif emotions_list[s]=="sadness": emotions_list[s]="sadness 😭"
12
- else: print(s)
13
-
14
- return emotions_list
15
-
16
-
17
- def spider_chart(dictionary):
18
-
19
- fig = go.Figure(data=go.Scatterpolar(
20
- r=[round(v*100,2) for v in dictionary.values()],
21
- theta= add_emoji([k for k in dictionary.keys()]),
22
- fill='toself'))
23
-
24
- fig.update_layout(
25
- polar=dict(
26
- radialaxis=dict(
27
- visible=True
28
- ),
29
- ),
30
- showlegend=False,
31
- width = 400, height = 400,
32
- title = "Audio Sentiment Analysis", title_x=0.5)
33
-
34
- return fig