jitesh commited on
Commit
0c756f9
1 Parent(s): 86f2d3a

adds plotely violin

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import streamlit as st
2
  from story_gen import StoryGenerator
 
 
3
 
4
  st.set_page_config(page_title='Storytelling ' +
5
  u'\U0001F5BC', page_icon=u'\U0001F5BC', layout="wide")
@@ -34,8 +36,12 @@ if mode == 'Create Statistics':
34
  num_generation=num_generation, length=length, reaction_weight=reaction_weight, num_tests=num_tests)
35
  if len(gen.stories) > 0:
36
  for si, story in enumerate(gen.stories):
37
- st.markdown(f'Story no. {si}:', unsafe_allow_html=False)
38
  st.markdown(story, unsafe_allow_html=False)
 
 
 
 
39
 
40
  elif mode == 'Create Statistics':
41
  container_mode.write('Let\'s play storytelling.')
 
1
  import streamlit as st
2
  from story_gen import StoryGenerator
3
+ import plotly.figure_factory as ff
4
+ import plotly.express as px
5
 
6
  st.set_page_config(page_title='Storytelling ' +
7
  u'\U0001F5BC', page_icon=u'\U0001F5BC', layout="wide")
 
36
  num_generation=num_generation, length=length, reaction_weight=reaction_weight, num_tests=num_tests)
37
  if len(gen.stories) > 0:
38
  for si, story in enumerate(gen.stories):
39
+ st.markdown(f'### Story no. {si}:', unsafe_allow_html=False)
40
  st.markdown(story, unsafe_allow_html=False)
41
+ data=gen.stats_df[gen.stats_df.sentence_no==3]
42
+ fig = px.violin(data_frame=data, x="reaction_weight", y="num_reactions", hover_data=data.columns)
43
+ st.plotly_chart(fig, use_container_width=True)
44
+
45
 
46
  elif mode == 'Create Statistics':
47
  container_mode.write('Let\'s play storytelling.')