hongaik commited on
Commit
c6b7b65
·
1 Parent(s): 8ad74f7

add charts

Browse files
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +4 -6
  2. app.py +4 -6
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -14,8 +14,7 @@ if st.button('Click for predictions!'):
14
  topics_prob, sentiment_prob = get_single_prediction(feedback)
15
 
16
  bar = px.bar(topics_prob, x='probability', y='topic')
17
- st.plotly_chart(bar, use_container_width=True)
18
-
19
  pie = px.pie(sentiment_prob,
20
  values='probability',
21
  names='sentiment',
@@ -25,10 +24,9 @@ if st.button('Click for predictions!'):
25
  },
26
  color='sentiment'
27
  )
28
- st.plotly_chart(pie, use_container_width=True)
29
-
30
-
31
- #st.success(f'Your text has been predicted to fall under the following topics: {result[:-1]}. The sentiment of this text is {result[-1]}.')
32
 
33
  st.write("\n")
34
  st.subheader('Or... Upload a csv file if you have a file instead.')
 
14
  topics_prob, sentiment_prob = get_single_prediction(feedback)
15
 
16
  bar = px.bar(topics_prob, x='probability', y='topic')
17
+
 
18
  pie = px.pie(sentiment_prob,
19
  values='probability',
20
  names='sentiment',
 
24
  },
25
  color='sentiment'
26
  )
27
+ st.plotly_chart(bar, use_container_width=True)
28
+ st.plotly_chart(pie, use_container_width=True)
29
+
 
30
 
31
  st.write("\n")
32
  st.subheader('Or... Upload a csv file if you have a file instead.')
app.py CHANGED
@@ -14,8 +14,7 @@ if st.button('Click for predictions!'):
14
  topics_prob, sentiment_prob = get_single_prediction(feedback)
15
 
16
  bar = px.bar(topics_prob, x='probability', y='topic')
17
- st.plotly_chart(bar, use_container_width=True)
18
-
19
  pie = px.pie(sentiment_prob,
20
  values='probability',
21
  names='sentiment',
@@ -25,10 +24,9 @@ if st.button('Click for predictions!'):
25
  },
26
  color='sentiment'
27
  )
28
- st.plotly_chart(pie, use_container_width=True)
29
-
30
-
31
- #st.success(f'Your text has been predicted to fall under the following topics: {result[:-1]}. The sentiment of this text is {result[-1]}.')
32
 
33
  st.write("\n")
34
  st.subheader('Or... Upload a csv file if you have a file instead.')
 
14
  topics_prob, sentiment_prob = get_single_prediction(feedback)
15
 
16
  bar = px.bar(topics_prob, x='probability', y='topic')
17
+
 
18
  pie = px.pie(sentiment_prob,
19
  values='probability',
20
  names='sentiment',
 
24
  },
25
  color='sentiment'
26
  )
27
+ st.plotly_chart(bar, use_container_width=True)
28
+ st.plotly_chart(pie, use_container_width=True)
29
+
 
30
 
31
  st.write("\n")
32
  st.subheader('Or... Upload a csv file if you have a file instead.')