Update pages/home.py
Browse files- pages/home.py +41 -31
pages/home.py
CHANGED
@@ -1,8 +1,46 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
import streamlit.components.v1 as components
|
3 |
-
from streamlit_shortcuts import button, add_keyboard_shortcuts
|
4 |
-
import base64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
st.title("📘Named Entity Recognition")
|
7 |
|
8 |
st.header("Tags the below 41 medical entities")
|
@@ -47,32 +85,4 @@ st.header("Tags the below 41 medical entities")
|
|
47 |
'TIME'
|
48 |
'VOLUME'
|
49 |
'WEIGHT'
|
50 |
-
|
51 |
-
# --- Automatic Scrolling Approach ---
|
52 |
-
# Add a checkbox to control auto-scrolling
|
53 |
-
auto_scroll = st.sidebar.checkbox("Auto-scroll to bottom", value=True)
|
54 |
-
|
55 |
-
# Create scrollable content
|
56 |
-
for i in range(100):
|
57 |
-
st.write(f"This is scrollable content line {i}")
|
58 |
-
|
59 |
-
# Add a manual scroll button at both top and bottom for convenience
|
60 |
-
if st.button("Scroll to Bottom") or auto_scroll:
|
61 |
-
# Create a link target
|
62 |
-
st.markdown('''
|
63 |
-
<a name="bottom"></a>
|
64 |
-
''', unsafe_allow_html=True)
|
65 |
-
|
66 |
-
# Use Streamlit's HTML component to execute the scroll
|
67 |
-
st.components.v1.html('''
|
68 |
-
<script>
|
69 |
-
// Use the iframe parent to scroll the main content area
|
70 |
-
window.parent.document.querySelector('section.main').scrollTo({
|
71 |
-
top: window.parent.document.querySelector('section.main').scrollHeight,
|
72 |
-
behavior: 'smooth'
|
73 |
-
});
|
74 |
-
</script>
|
75 |
-
''', height=0)
|
76 |
-
|
77 |
-
# Add some text at the bottom as a visual indicator
|
78 |
-
st.write("You've reached the bottom!")
|
|
|
1 |
+
|
2 |
import streamlit as st
|
3 |
import streamlit.components.v1 as components
|
4 |
+
from streamlit_shortcuts import button, add_keyboard_shortcuts # Keep these if you need them
|
5 |
+
import base64 # Keep this if you need it
|
6 |
+
|
7 |
+
st.title("📘Named Entity Recognition")
|
8 |
+
st.header("Tags the below 41 medical entities")
|
9 |
+
|
10 |
+
# Your list of entities
|
11 |
+
entities = [
|
12 |
+
'ACTIVITY', 'ADMINISTRATION', 'AGE', 'AREA', 'BIOLOGICAL_ATTRIBUTE',
|
13 |
+
'BIOLOGICAL_STRUCTURE', 'BODY_PART', 'CESIUM_UNIT', 'CHEMICAL', 'CLASS',
|
14 |
+
'COLOR', 'COREFERENCE', 'DATE', 'DIMENSION', 'DOSAGE', 'DISTANCE',
|
15 |
+
'DURATION', 'ENERGY', 'FREQUENCY', 'HUMAN_IDENTIFIER', 'IDC_CODE',
|
16 |
+
'ID_NUMBER', 'LAB_VALUE', 'LOCATION', 'MEASUREMENT', 'MEDICAL_DEVICE',
|
17 |
+
'MEDICAL_PROCEDURE', 'MODE', 'NANOMETER', 'OBJECTIVE', 'OCCUPATION',
|
18 |
+
'ORGANISM', 'PERCENT', 'PERSONAL_RELATION', 'PHYSICAL_FINDING',
|
19 |
+
'PROCEDURE', 'QUALITATIVE_VALUE', 'QUANTITY', 'RATE', 'SCALE',
|
20 |
+
'SEX', 'SIGN', 'STATUS', 'SUBJECTIVE', 'TEMPORALITY', 'TEST',
|
21 |
+
'TIME', 'TOPIC', 'UNIT', 'VITAL_SIGN', 'WEIGHT'
|
22 |
+
]
|
23 |
+
|
24 |
+
for entity in entities:
|
25 |
+
st.write(entity)
|
26 |
+
|
27 |
+
# Create scrollable content
|
28 |
+
for i in range(100):
|
29 |
+
st.write(f"This is scrollable content line {i}")
|
30 |
|
31 |
+
# JavaScript to scroll to the bottom
|
32 |
+
scroll_script = """
|
33 |
+
<script>
|
34 |
+
var body = window.parent.document.querySelector(".main");
|
35 |
+
body.scrollTop = body.scrollHeight;
|
36 |
+
</script>
|
37 |
+
"""
|
38 |
+
|
39 |
+
# Inject the JavaScript
|
40 |
+
components.html(scroll_script, height=0, width=0)
|
41 |
+
|
42 |
+
|
43 |
+
'''
|
44 |
st.title("📘Named Entity Recognition")
|
45 |
|
46 |
st.header("Tags the below 41 medical entities")
|
|
|
85 |
'TIME'
|
86 |
'VOLUME'
|
87 |
'WEIGHT'
|
88 |
+
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|