Spaces:
Sleeping
Sleeping
windyeh
commited on
Commit
·
6f26859
1
Parent(s):
6b6ccc2
update version
Browse files
app.py
CHANGED
@@ -1,9 +1,20 @@
|
|
1 |
import streamlit as st
|
|
|
2 |
import monpa
|
3 |
|
4 |
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
st.write(f'斷詞結果:\n')
|
8 |
-
for item in chunk
|
9 |
-
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
import streamlit.components.v1 as components
|
3 |
import monpa
|
4 |
|
5 |
|
6 |
+
st.title("Multi-Objective NER POS Annotator @ TMU")
|
7 |
+
|
8 |
+
text = st.text_input('請在下方輸入欲斷詞的句子,限 200 字以內...', placeholder='今天天氣很好。')
|
9 |
+
try:
|
10 |
+
chunk = monpa.pseg(text)
|
11 |
+
except:
|
12 |
+
st.markdown(f':red[發生錯誤,請重新輸入]')
|
13 |
+
|
14 |
st.write(f'斷詞結果:\n')
|
15 |
+
result = "$~~~~~~$".join(f"{item[0]} `{item[1]}`" for item in chunk if item)
|
16 |
+
st.markdown(f'### {result}')
|
17 |
+
|
18 |
+
st.divider()
|
19 |
+
st.markdown('[NLP Lab,](https://nlp.tmu.edu.tw/)')
|
20 |
+
st.markdown('Graduate Institute of Data Science @ TMU')
|