Spaces:
Runtime error
Runtime error
Commit
·
faf86dc
1
Parent(s):
5b2a077
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,19 +9,37 @@ basemodel = pipeline("ner", model="/home/user/app/base-model/", tokenizer="indol
|
|
| 9 |
|
| 10 |
st.title(':blue[MendoBERT] - Named Entity Recognition :sunglasses:')
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
st.caption('_Examples_')
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
if text:
|
|
|
|
| 9 |
|
| 10 |
st.title(':blue[MendoBERT] - Named Entity Recognition :sunglasses:')
|
| 11 |
|
| 12 |
+
|
| 13 |
+
if 'options' not in st.session_state:
|
| 14 |
+
st.session_state['options'] = ""
|
| 15 |
+
|
| 16 |
+
def button1_callback():
|
| 17 |
+
st.session_state['options'] = "Aspartylglucosaminuria (AGU) adalah gangguan metabolisme glikoprotein langka."
|
| 18 |
+
def button2_callback():
|
| 19 |
+
st.session_state['options'] = "Mutasi germ - line dari gen BRCA1 membuat wanita cenderung mengalami kanker payudara dini dengan mengorbankan fungsi presumtif gen sebagai penekan tumor."
|
| 20 |
+
|
| 21 |
+
placeholder = st.empty()
|
| 22 |
+
|
| 23 |
st.caption('_Examples_')
|
| 24 |
+
st.button('Aspartylglucosaminuria (AGU) adalah gangguan metabolisme glikoprotein langka.', use_container_width=True, on_click = button1_callback)
|
| 25 |
+
st.button('Mutasi germ - line dari gen BRCA1 membuat wanita cenderung mengalami kanker payudara dini dengan mengorbankan fungsi presumtif gen sebagai penekan tumor.', use_container_width=True, on_click = button2_callback)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# with st.container():
|
| 29 |
+
# example1 = st.button('Aspartylglucosaminuria (AGU) adalah gangguan metabolisme glikoprotein langka.', use_container_width=True)
|
| 30 |
+
# example2 = st.button('Mutasi germ - line dari gen BRCA1 membuat wanita cenderung mengalami kanker payudara dini dengan mengorbankan fungsi presumtif gen sebagai penekan tumor.', use_container_width=True)
|
| 31 |
+
|
| 32 |
+
with placeholder:
|
| 33 |
+
text = st.text_area('Enter some text: ', key = 'options')
|
| 34 |
+
|
| 35 |
+
# text = st.text_area('Enter some text: ')
|
| 36 |
+
|
| 37 |
+
# if example1:
|
| 38 |
+
# text1 = "Aspartylglucosaminuria (AGU) adalah gangguan metabolisme glikoprotein langka."
|
| 39 |
+
# text.value = text1
|
| 40 |
+
# elif example2:
|
| 41 |
+
# text2 = "Mutasi germ - line dari gen BRCA1 membuat wanita cenderung mengalami kanker payudara dini dengan mengorbankan fungsi presumtif gen sebagai penekan tumor."
|
| 42 |
+
# text.value = text2
|
| 43 |
|
| 44 |
|
| 45 |
if text:
|