Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,16 @@ import matplotlib.pyplot as plt
|
|
7 |
import squarify
|
8 |
import numpy as np
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# Define the HTML and CSS styles
|
11 |
st.markdown("""
|
12 |
<style>
|
@@ -31,11 +41,11 @@ if opt == "Neuroblastoma corpus":
|
|
31 |
num_abstracts = 29032
|
32 |
database_name = "Neuroblastoma"
|
33 |
|
34 |
-
|
35 |
-
st.
|
36 |
st.subheader("Uncovering knowledge through Natural Language Processing (NLP)")
|
37 |
-
st.subheader("Open sidebar to choose corpus")
|
38 |
|
|
|
39 |
text_input_value = st.text_input(f"Enter one term to search within the {database_name} corpus", max_chars=50)
|
40 |
query = text_input_value
|
41 |
query = query.lower()
|
@@ -43,7 +53,7 @@ query = query.lower()
|
|
43 |
if query:
|
44 |
bar = st.progress(0)
|
45 |
time.sleep(.2)
|
46 |
-
st.caption(f":LightSkyBlue[searching {num_abstracts} {database_name} PubMed abstracts]")
|
47 |
for i in range(10):
|
48 |
bar.progress((i + 1) * 10)
|
49 |
time.sleep(.1)
|
@@ -135,9 +145,23 @@ if query:
|
|
135 |
st.pyplot(fig2)
|
136 |
|
137 |
csv = df1.head(100).to_csv().encode('utf-8')
|
138 |
-
st.download_button(label="download top 100 genes (csv)", data=csv, file_name=f'{database_name}_genes.csv',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
-
# findRelationships(query, df)
|
141 |
|
142 |
|
143 |
# model = gensim.models.KeyedVectors.load_word2vec_format('pubmed_model_clotting', binary=True)
|
|
|
7 |
import squarify
|
8 |
import numpy as np
|
9 |
|
10 |
+
st.set_page_config(
|
11 |
+
page_title="FATA4 Science",
|
12 |
+
page_icon=":microscope:",
|
13 |
+
layout="wide",
|
14 |
+
initial_sidebar_state="expanded",
|
15 |
+
menu_items={
|
16 |
+
'About': "FATA4 Science is a Natural Language Processing (NLP) that ...."
|
17 |
+
}
|
18 |
+
)
|
19 |
+
|
20 |
# Define the HTML and CSS styles
|
21 |
st.markdown("""
|
22 |
<style>
|
|
|
41 |
num_abstracts = 29032
|
42 |
database_name = "Neuroblastoma"
|
43 |
|
44 |
+
st.title(":red[Fast Acting Text Analysis (FATA) 4 Science]")
|
45 |
+
st.markdown("---")
|
46 |
st.subheader("Uncovering knowledge through Natural Language Processing (NLP)")
|
|
|
47 |
|
48 |
+
st.header(f"{database_name} Pubmed corpus.")
|
49 |
text_input_value = st.text_input(f"Enter one term to search within the {database_name} corpus", max_chars=50)
|
50 |
query = text_input_value
|
51 |
query = query.lower()
|
|
|
53 |
if query:
|
54 |
bar = st.progress(0)
|
55 |
time.sleep(.2)
|
56 |
+
st.caption(f":LightSkyBlue[searching {num_abstracts} {database_name} PubMed abstracts] covering 1990-2022")
|
57 |
for i in range(10):
|
58 |
bar.progress((i + 1) * 10)
|
59 |
time.sleep(.1)
|
|
|
145 |
st.pyplot(fig2)
|
146 |
|
147 |
csv = df1.head(100).to_csv().encode('utf-8')
|
148 |
+
st.download_button(label="download top 100 genes (csv)", data=csv, file_name=f'{database_name}_genes.csv',
|
149 |
+
mime='text/csv')
|
150 |
+
|
151 |
+
DEFAULT_WIDTH = 80
|
152 |
+
VIDEO_DATA = f"https://www.youtube.com/@NCIgov/search?query=cancer"
|
153 |
+
|
154 |
+
width = st.sidebar.slider(
|
155 |
+
label="Width", min_value=0, max_value=100, value=DEFAULT_WIDTH, format="%d%%"
|
156 |
+
)
|
157 |
+
|
158 |
+
width = max(width, 0.01)
|
159 |
+
side = max((100 - width) / 2, 0.01)
|
160 |
+
|
161 |
+
_, container, _ = st.columns([side, width, side])
|
162 |
+
container.video(data=VIDEO_DATA)
|
163 |
+
|
164 |
|
|
|
165 |
|
166 |
|
167 |
# model = gensim.models.KeyedVectors.load_word2vec_format('pubmed_model_clotting', binary=True)
|