glitch0011 commited on
Commit
dcb64e4
·
1 Parent(s): 08b8ceb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -3
app.py CHANGED
@@ -6,7 +6,16 @@ from ipymarkup import format_span_box_markup
6
  model = pipeline("ner", model="/home/user/app/mendobert/", tokenizer="indolem/indobert-base-uncased")
7
  basemodel = pipeline("ner", model="/home/user/app/base-model/", tokenizer="indolem/indobert-base-uncased")
8
 
9
- text = st.text_area('enter some text: ')
 
 
 
 
 
 
 
 
 
10
 
11
  if text:
12
  ner_results = model(text)
@@ -85,8 +94,13 @@ if text:
85
  formatBase = format_span_box_markup(text, spanBase)
86
  htmlBase = ''.join(formatBase)
87
 
88
- st.json(base)
89
- st.markdown(htmlBase,unsafe_allow_html=True)
90
  st.json(mendo)
91
  st.markdown(htmlMendo,unsafe_allow_html=True)
 
 
 
 
 
92
 
 
6
  model = pipeline("ner", model="/home/user/app/mendobert/", tokenizer="indolem/indobert-base-uncased")
7
  basemodel = pipeline("ner", model="/home/user/app/base-model/", tokenizer="indolem/indobert-base-uncased")
8
 
9
+ st.title(':blue[MendoBERT] - Named Entity Recognition Model :sunglasses:')
10
+ if example1:
11
+ text = st.text_area('Enter some text: ', 'Aspartylglucosaminuria (AGU) adalah gangguan metabolisme glikoprotein langka.')
12
+ elif example2:
13
+ text = st.text_area('Enter some text: ', 'Mutasi germ - line dari gen BRCA1 membuat wanita cenderung mengalami kanker payudara dini dengan mengorbankan fungsi presumtif gen sebagai penekan tumor.')
14
+ else
15
+ text = st.text_area('Enter some text: ', 'Enter your texts here...')
16
+
17
+ example1 = st.button('Aspartylglucosaminuria (AGU) adalah gangguan metabolisme glikoprotein langka.')
18
+ example2 = st.button('Mutasi germ - line dari gen BRCA1 membuat wanita cenderung mengalami kanker payudara dini dengan mengorbankan fungsi presumtif gen sebagai penekan tumor.')
19
 
20
  if text:
21
  ner_results = model(text)
 
94
  formatBase = format_span_box_markup(text, spanBase)
95
  htmlBase = ''.join(formatBase)
96
 
97
+ st.divider
98
+ st.subheader('MendoBERT')
99
  st.json(mendo)
100
  st.markdown(htmlMendo,unsafe_allow_html=True)
101
+ st.divider
102
+ st.subheader('IndoLEM')
103
+ st.json(base)
104
+ st.markdown(htmlBase,unsafe_allow_html=True)
105
+
106