Spaces:
Runtime error
Runtime error
Commit
Β·
37d2b76
1
Parent(s):
bc6274a
updating blog markdowns
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ def load_data():
|
|
| 23 |
"""
|
| 24 |
|
| 25 |
st.header('π Load Data')
|
| 26 |
-
read_md('markdown/load_data.md')
|
| 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 +73,7 @@ def topic_modeling(data):
|
|
| 73 |
"""
|
| 74 |
|
| 75 |
st.header('π₯ Topic Modeling')
|
| 76 |
-
read_md('markdown/topic_modeling.md')
|
| 77 |
|
| 78 |
cols = st.columns(3)
|
| 79 |
with cols[0]:
|
|
@@ -122,7 +122,7 @@ def strip_network(data, topic_data, topics):
|
|
| 122 |
"""
|
| 123 |
|
| 124 |
st.header('π STriP Network')
|
| 125 |
-
read_md('markdown/stripnet.md')
|
| 126 |
|
| 127 |
with st.spinner('Cosine Similarity Calculation'):
|
| 128 |
cosine_sim_matrix = helpers.cosine_sim(data)
|
|
@@ -180,7 +180,7 @@ def network_centrality(nx_net, topic_data):
|
|
| 180 |
"""
|
| 181 |
|
| 182 |
st.header('π
Most Important Papers')
|
| 183 |
-
read_md('markdown/centrality.md')
|
| 184 |
|
| 185 |
centrality_mapping = {
|
| 186 |
'Betweenness Centrality': nx.betweenness_centrality,
|
|
@@ -209,14 +209,14 @@ def read_md(file_path):
|
|
| 209 |
"""Reads a markdown file and returns the contents as a streamlit markdown component.
|
| 210 |
"""
|
| 211 |
with open(file_path, 'r') as f:
|
| 212 |
-
content =
|
| 213 |
|
| 214 |
return content
|
| 215 |
|
| 216 |
|
| 217 |
def main():
|
| 218 |
st.title('STriPNet: Semantic Similarity of Scientific Papers!')
|
| 219 |
-
read_md('markdown/about_stripnet.md')
|
| 220 |
|
| 221 |
logger.info('========== Step1: Loading data ==========')
|
| 222 |
data, selected_cols = load_data()
|
|
@@ -231,7 +231,7 @@ def main():
|
|
| 231 |
logger.info('========== Step4: Network Centrality ==========')
|
| 232 |
network_centrality(nx_net, topic_data)
|
| 233 |
|
| 234 |
-
read_md('markdown/about_me.md')
|
| 235 |
|
| 236 |
|
| 237 |
if __name__ == '__main__':
|
|
|
|
| 23 |
"""
|
| 24 |
|
| 25 |
st.header('π Load Data')
|
| 26 |
+
st.markdown(read_md('markdown/load_data.md'))
|
| 27 |
|
| 28 |
uploaded_file = st.file_uploader("Choose a CSV file",
|
| 29 |
help='Upload a CSV file with the following columns: Title, Abstract')
|
|
|
|
| 73 |
"""
|
| 74 |
|
| 75 |
st.header('π₯ Topic Modeling')
|
| 76 |
+
st.markdown(read_md('markdown/topic_modeling.md'))
|
| 77 |
|
| 78 |
cols = st.columns(3)
|
| 79 |
with cols[0]:
|
|
|
|
| 122 |
"""
|
| 123 |
|
| 124 |
st.header('π STriP Network')
|
| 125 |
+
st.markdown(read_md('markdown/stripnet.md'))
|
| 126 |
|
| 127 |
with st.spinner('Cosine Similarity Calculation'):
|
| 128 |
cosine_sim_matrix = helpers.cosine_sim(data)
|
|
|
|
| 180 |
"""
|
| 181 |
|
| 182 |
st.header('π
Most Important Papers')
|
| 183 |
+
st.markdown(read_md('markdown/centrality.md'))
|
| 184 |
|
| 185 |
centrality_mapping = {
|
| 186 |
'Betweenness Centrality': nx.betweenness_centrality,
|
|
|
|
| 209 |
"""Reads a markdown file and returns the contents as a streamlit markdown component.
|
| 210 |
"""
|
| 211 |
with open(file_path, 'r') as f:
|
| 212 |
+
content = f.read()
|
| 213 |
|
| 214 |
return content
|
| 215 |
|
| 216 |
|
| 217 |
def main():
|
| 218 |
st.title('STriPNet: Semantic Similarity of Scientific Papers!')
|
| 219 |
+
st.markdown(read_md('markdown/about_stripnet.md'))
|
| 220 |
|
| 221 |
logger.info('========== Step1: Loading data ==========')
|
| 222 |
data, selected_cols = load_data()
|
|
|
|
| 231 |
logger.info('========== Step4: Network Centrality ==========')
|
| 232 |
network_centrality(nx_net, topic_data)
|
| 233 |
|
| 234 |
+
st.markdown(read_md('markdown/about_me.md'))
|
| 235 |
|
| 236 |
|
| 237 |
if __name__ == '__main__':
|