jpdiazpardo's picture
Create charts.py
7b2e448
raw
history blame
No virus
481 Bytes
import plotly.graph_objects as go
def spider_chart(classifier, text):
fig = go.Figure(data=go.Scatterpolar(
r=[round(s['score']*100,2) for s in classifier.predict(text)[0]],
theta= [l['label'] for l in classifier.predict(text)[0]],
fill='toself'))
fig.update_layout(
polar=dict(
radialaxis=dict(
visible=True
),
),
showlegend=False,
width = 400, height = 400,
title = "Audio Sentiment Analysis", title_x=0.5)
return fig