mestreamlit / pages /3_🐧_εˆ†θ―.py
yuanjie
update
3369999
raw
history blame contribute delete
899 Bytes
from meutils.pipe import *
from appzoo.streamlit_app import Page
import streamlit as st
from LAC import LAC
# @st.experimental_memo(persist='disk', show_spinner=True, suppress_st_warning=False, max_entries=None, ttl=64)
@st.cache(func=None, persist=False, hash_funcs={'LAC.lac.LAC': str}, ttl=8)
def tokenizer1():
print('Loading tokenizer1...')
return LAC()
@st.experimental_singleton
def tokenizer2():
print('Loading tokenizer2...')
return LAC()
class MyPage(Page):
def main(self):
with st.form("Coding"):
text = st.text_input("θΎ“ε…₯ζ–‡ζœ¬", "")
if st.form_submit_button('开始转捒'):
_ = tokenizer1().run(text)
_ = tokenizer2().run(text)
st.json(_)
if __name__ == '__main__':
app_title = "# εˆ‡θ―"
app_info = ""
MyPage(app_title=app_title, app_info=app_info).main()