Spaces:
Sleeping
Sleeping
kargaranamir
commited on
Commit
·
df1df2c
1
Parent(s):
6a80c4a
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,28 @@ from parstdex import Parstdex
|
|
5 |
# set config
|
6 |
st.set_page_config(layout="wide", page_title="Parstdex")
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
# APP
|
11 |
# set title and subtitle
|
@@ -27,10 +48,10 @@ with st.spinner("Processing Text and Extracting..."):
|
|
27 |
|
28 |
# display the result
|
29 |
st.markdown("**Span:**")
|
30 |
-
st.
|
31 |
st.markdown("**Marker:**")
|
32 |
-
st.
|
33 |
st.markdown("**Time_ML:**")
|
34 |
-
st.
|
35 |
st.markdown("**NER:**")
|
36 |
-
st.
|
|
|
5 |
# set config
|
6 |
st.set_page_config(layout="wide", page_title="Parstdex")
|
7 |
|
8 |
+
# Layout adjustments
|
9 |
+
st.markdown(
|
10 |
+
"""
|
11 |
+
<style>
|
12 |
+
.reportview-container .main .block-container {
|
13 |
+
max-width: 1400px;
|
14 |
+
}
|
15 |
+
</style>
|
16 |
+
""",
|
17 |
+
unsafe_allow_html=True,
|
18 |
+
)
|
19 |
+
|
20 |
+
|
21 |
+
# Load models lazily
|
22 |
+
@st.cache(allow_output_mutation=True)
|
23 |
+
def load_model():
|
24 |
+
model = Parstdex()
|
25 |
+
return model
|
26 |
+
|
27 |
+
with st.spinner(text="Please wait while the model is loading...."):
|
28 |
+
# cache
|
29 |
+
model = Parstdex()
|
30 |
|
31 |
# APP
|
32 |
# set title and subtitle
|
|
|
48 |
|
49 |
# display the result
|
50 |
st.markdown("**Span:**")
|
51 |
+
st.code(spans, language="python")
|
52 |
st.markdown("**Marker:**")
|
53 |
+
st.code(markers, language="python")
|
54 |
st.markdown("**Time_ML:**")
|
55 |
+
st.code(f"\u202b{time_mls}\u202c", language="python")
|
56 |
st.markdown("**NER:**")
|
57 |
+
st.code(ners, language="python")
|