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