Spaces:
Runtime error
Runtime error
jpdiazpardo
commited on
Commit
•
7b2e448
1
Parent(s):
91eabf4
Create charts.py
Browse files
charts.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import plotly.graph_objects as go
|
2 |
+
|
3 |
+
def spider_chart(classifier, text):
|
4 |
+
|
5 |
+
fig = go.Figure(data=go.Scatterpolar(
|
6 |
+
r=[round(s['score']*100,2) for s in classifier.predict(text)[0]],
|
7 |
+
theta= [l['label'] for l in classifier.predict(text)[0]],
|
8 |
+
fill='toself'))
|
9 |
+
|
10 |
+
fig.update_layout(
|
11 |
+
polar=dict(
|
12 |
+
radialaxis=dict(
|
13 |
+
visible=True
|
14 |
+
),
|
15 |
+
),
|
16 |
+
showlegend=False,
|
17 |
+
width = 400, height = 400,
|
18 |
+
title = "Audio Sentiment Analysis", title_x=0.5)
|
19 |
+
|
20 |
+
return fig
|