Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,10 @@ import urllib.request
|
|
13 |
import random
|
14 |
import plotly.express as px
|
15 |
|
16 |
-
st.set_page_config(page_title="
|
17 |
initial_sidebar_state="auto",
|
18 |
-
menu_items={'About': "
|
19 |
-
" insight from pubmed abstracts. Created by Jimmie E. Fata, PhD"})
|
20 |
|
21 |
# Define the HTML and CSS styles
|
22 |
st.markdown("""
|
@@ -41,25 +41,21 @@ st.markdown("""
|
|
41 |
</style>
|
42 |
""", unsafe_allow_html=True)
|
43 |
|
44 |
-
st.header(":red[*
|
45 |
|
46 |
st.subheader(
|
47 |
"*A web app designed to explore :red[*PubMed abstracts*] for deeper understanding and fresh insights, driven "
|
48 |
-
"by Natural Language Processing (NLP)
|
49 |
|
50 |
|
51 |
def custom_subheader(text, identifier, font_size):
|
52 |
st.markdown(f"<h3 id='{identifier}' style='font-size: {font_size}px;'>{text}</h3>", unsafe_allow_html=True)
|
53 |
|
54 |
|
55 |
-
custom_subheader("
|
56 |
-
"
|
57 |
-
"you wish to explore within the corpus. Abstractalytics powerful Natural Language "
|
58 |
-
"Processing (NLP) algorithms will analyze the chosen corpus and present you with a list of top words, "
|
59 |
"genes, drugs, phytochemicals, and compounds that are contextually and semantically related "
|
60 |
-
"to your input.
|
61 |
-
"relationships, uncovering new discoveries and connections in your field of research across a massive "
|
62 |
-
"amount of abstracts. Dive in and enjoy the exploration! More oncology-related corpora comming soon.",
|
63 |
"unique-id", 18)
|
64 |
|
65 |
st.markdown("---")
|
@@ -79,7 +75,8 @@ st.markdown("---")
|
|
79 |
#
|
80 |
# # If the password is correct, show the app content
|
81 |
# if authenticate(password):
|
82 |
-
opt = st.sidebar.radio("Select a PubMed Corpus", options=('Breast Cancer corpus', 'Lung Cancer corpus',
|
|
|
83 |
# if opt == "Clotting corpus":
|
84 |
# model_used = ("pubmed_model_clotting")
|
85 |
# num_abstracts = 45493
|
@@ -100,9 +97,13 @@ if opt == "Breast Cancer corpus":
|
|
100 |
model_used = ("pubmed_model_breast_cancer2")
|
101 |
num_abstracts = 204381
|
102 |
database_name = "Breast_cancer"
|
|
|
|
|
|
|
|
|
103 |
if opt == "Prostate Cancer corpus":
|
104 |
model_used = ("prostate_cancer_pubmed_model")
|
105 |
-
num_abstracts =
|
106 |
database_name = "Prostate_cancer"
|
107 |
|
108 |
st.header(f":blue[{database_name} Pubmed corpus.]")
|
|
|
13 |
import random
|
14 |
import plotly.express as px
|
15 |
|
16 |
+
st.set_page_config(page_title="OncoDigger", page_icon=":microscope:", layout="wide", # centered
|
17 |
initial_sidebar_state="auto",
|
18 |
+
menu_items={'About': "OncoDigger is a Natural Language Processing (NLP) that harnesses Word2Vec to mine"
|
19 |
+
" insight from pubmed abstracts. Created by Jimmie E. Fata, PhD, fata4science@gmail.com"})
|
20 |
|
21 |
# Define the HTML and CSS styles
|
22 |
st.markdown("""
|
|
|
41 |
</style>
|
42 |
""", unsafe_allow_html=True)
|
43 |
|
44 |
+
st.header(":red[*O*]nco:red[*D*]igger")
|
45 |
|
46 |
st.subheader(
|
47 |
"*A web app designed to explore :red[*PubMed abstracts*] for deeper understanding and fresh insights, driven "
|
48 |
+
"by Machine Learning and Natural Language Processing (NLP) algorithms.*")
|
49 |
|
50 |
|
51 |
def custom_subheader(text, identifier, font_size):
|
52 |
st.markdown(f"<h3 id='{identifier}' style='font-size: {font_size}px;'>{text}</h3>", unsafe_allow_html=True)
|
53 |
|
54 |
|
55 |
+
custom_subheader("To begin, simply select a corpus from the left sidebar and enter a keyword "
|
56 |
+
"you wish to explore within the corpus. OncoDigger will determine the top words, "
|
|
|
|
|
57 |
"genes, drugs, phytochemicals, and compounds that are contextually and semantically related "
|
58 |
+
"to your input. Dive in and enjoy the exploration!",
|
|
|
|
|
59 |
"unique-id", 18)
|
60 |
|
61 |
st.markdown("---")
|
|
|
75 |
#
|
76 |
# # If the password is correct, show the app content
|
77 |
# if authenticate(password):
|
78 |
+
opt = st.sidebar.radio("Select a PubMed Corpus", options=('Breast Cancer corpus', 'Lung Cancer corpus',
|
79 |
+
'Colorectal Cancer corpus', 'Prostate Cancer corpus'))
|
80 |
# if opt == "Clotting corpus":
|
81 |
# model_used = ("pubmed_model_clotting")
|
82 |
# num_abstracts = 45493
|
|
|
97 |
model_used = ("pubmed_model_breast_cancer2")
|
98 |
num_abstracts = 204381
|
99 |
database_name = "Breast_cancer"
|
100 |
+
if opt == "Colorectal Cancer corpus":
|
101 |
+
model_used = ("colorectal_cancer_pubmed_model")
|
102 |
+
num_abstracts = 140000
|
103 |
+
database_name = "Colorectal_cancer"
|
104 |
if opt == "Prostate Cancer corpus":
|
105 |
model_used = ("prostate_cancer_pubmed_model")
|
106 |
+
num_abstracts = 89782
|
107 |
database_name = "Prostate_cancer"
|
108 |
|
109 |
st.header(f":blue[{database_name} Pubmed corpus.]")
|