Spaces:
Runtime error
Runtime error
stephenleo
commited on
Commit
β’
d10a664
1
Parent(s):
37d2b76
updating markdowns again
Browse files
app.py
CHANGED
@@ -23,7 +23,8 @@ def load_data():
|
|
23 |
"""
|
24 |
|
25 |
st.header('π Load Data')
|
26 |
-
|
|
|
27 |
|
28 |
uploaded_file = st.file_uploader("Choose a CSV file",
|
29 |
help='Upload a CSV file with the following columns: Title, Abstract')
|
@@ -73,7 +74,8 @@ def topic_modeling(data):
|
|
73 |
"""
|
74 |
|
75 |
st.header('π₯ Topic Modeling')
|
76 |
-
|
|
|
77 |
|
78 |
cols = st.columns(3)
|
79 |
with cols[0]:
|
@@ -122,7 +124,8 @@ def strip_network(data, topic_data, topics):
|
|
122 |
"""
|
123 |
|
124 |
st.header('π STriP Network')
|
125 |
-
|
|
|
126 |
|
127 |
with st.spinner('Cosine Similarity Calculation'):
|
128 |
cosine_sim_matrix = helpers.cosine_sim(data)
|
@@ -180,7 +183,8 @@ def network_centrality(nx_net, topic_data):
|
|
180 |
"""
|
181 |
|
182 |
st.header('π
Most Important Papers')
|
183 |
-
|
|
|
184 |
|
185 |
centrality_mapping = {
|
186 |
'Betweenness Centrality': nx.betweenness_centrality,
|
@@ -206,7 +210,7 @@ def network_centrality(nx_net, topic_data):
|
|
206 |
|
207 |
|
208 |
def read_md(file_path):
|
209 |
-
"""Reads a markdown file and returns the contents
|
210 |
"""
|
211 |
with open(file_path, 'r') as f:
|
212 |
content = f.read()
|
@@ -216,7 +220,8 @@ def read_md(file_path):
|
|
216 |
|
217 |
def main():
|
218 |
st.title('STriPNet: Semantic Similarity of Scientific Papers!')
|
219 |
-
|
|
|
220 |
|
221 |
logger.info('========== Step1: Loading data ==========')
|
222 |
data, selected_cols = load_data()
|
@@ -231,7 +236,8 @@ def main():
|
|
231 |
logger.info('========== Step4: Network Centrality ==========')
|
232 |
network_centrality(nx_net, topic_data)
|
233 |
|
234 |
-
|
|
|
235 |
|
236 |
|
237 |
if __name__ == '__main__':
|
|
|
23 |
"""
|
24 |
|
25 |
st.header('π Load Data')
|
26 |
+
about_load_data = read_md('markdown/load_data.md')
|
27 |
+
st.markdown(about_load_data)
|
28 |
|
29 |
uploaded_file = st.file_uploader("Choose a CSV file",
|
30 |
help='Upload a CSV file with the following columns: Title, Abstract')
|
|
|
74 |
"""
|
75 |
|
76 |
st.header('π₯ Topic Modeling')
|
77 |
+
about_topic_modeling = read_md('markdown/topic_modeling.md')
|
78 |
+
st.markdown(about_topic_modeling)
|
79 |
|
80 |
cols = st.columns(3)
|
81 |
with cols[0]:
|
|
|
124 |
"""
|
125 |
|
126 |
st.header('π STriP Network')
|
127 |
+
about_stripnet = read_md('markdown/stripnet.md')
|
128 |
+
st.markdown(about_stripnet)
|
129 |
|
130 |
with st.spinner('Cosine Similarity Calculation'):
|
131 |
cosine_sim_matrix = helpers.cosine_sim(data)
|
|
|
183 |
"""
|
184 |
|
185 |
st.header('π
Most Important Papers')
|
186 |
+
about_centrality = read_md('markdown/centrality.md')
|
187 |
+
st.markdown(about_centrality)
|
188 |
|
189 |
centrality_mapping = {
|
190 |
'Betweenness Centrality': nx.betweenness_centrality,
|
|
|
210 |
|
211 |
|
212 |
def read_md(file_path):
|
213 |
+
"""Reads a markdown file and returns the contents.
|
214 |
"""
|
215 |
with open(file_path, 'r') as f:
|
216 |
content = f.read()
|
|
|
220 |
|
221 |
def main():
|
222 |
st.title('STriPNet: Semantic Similarity of Scientific Papers!')
|
223 |
+
about_stripnet = read_md('markdown/about_stripnet.md')
|
224 |
+
st.markdown(about_stripnet)
|
225 |
|
226 |
logger.info('========== Step1: Loading data ==========')
|
227 |
data, selected_cols = load_data()
|
|
|
236 |
logger.info('========== Step4: Network Centrality ==========')
|
237 |
network_centrality(nx_net, topic_data)
|
238 |
|
239 |
+
about_me = read_md('markdown/about_me.md')
|
240 |
+
st.markdown(about_me)
|
241 |
|
242 |
|
243 |
if __name__ == '__main__':
|