monpaweb-dev / app.py
windyeh
update version
6f26859
raw
history blame
619 Bytes
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')