hacpdsae2023 commited on
Commit
4b87d72
·
1 Parent(s): 096dd49

Fix bug with pandas from_dict and removed text

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -12,9 +12,7 @@ st.markdown('We study the relationshis between the stories using a network. The
12
  st.markdown('## Short Stories')
13
  st.markdown('We are using a sample fo the [TinyStories](roneneldan/TinyStories) dataset from roneneldan work')
14
  text_text = dataset['train'][10]['text']
15
- st.write(text_text)
16
- st.markdown(':red[' + text_text + ']' )
17
- st.markdown("The next word is <span style='color:red'>" + text_text.replace('\n',' ') + "</span>",unsafe_allow_html=True)
18
 
19
  st.markdown('The threshold changes the level of connectivity in the network. The reange is from 0 (less similar) to 1 (completely similar)')
20
  threshhold = st.slider('Threshhold',0.0,1.0,step=0.1)
@@ -113,5 +111,5 @@ return_value = agraph(nodes=nodes,
113
 
114
  st.markdown('The Laplacian centrality is a measure of closeness')
115
  st.write(str(nx.laplacian_centrality(G)))
116
- df_lc = pd.from_dict(nx.laplacian_centrality(G))
117
  st.bar_chart(df_lc)
 
12
  st.markdown('## Short Stories')
13
  st.markdown('We are using a sample fo the [TinyStories](roneneldan/TinyStories) dataset from roneneldan work')
14
  text_text = dataset['train'][10]['text']
15
+ st.markdown("<span style='color:red'>" + text_text.replace('\n',' ') + "</span>",unsafe_allow_html=True)
 
 
16
 
17
  st.markdown('The threshold changes the level of connectivity in the network. The reange is from 0 (less similar) to 1 (completely similar)')
18
  threshhold = st.slider('Threshhold',0.0,1.0,step=0.1)
 
111
 
112
  st.markdown('The Laplacian centrality is a measure of closeness')
113
  st.write(str(nx.laplacian_centrality(G)))
114
+ df_lc = pd.DataFrame.from_dict(nx.laplacian_centrality(G))
115
  st.bar_chart(df_lc)