ner-kazakh / app.py
yeshpanovrustem's picture
Update app.py
3a514c9
raw
history blame
828 Bytes
import streamlit as st
import transformers
# use @st.cache decorator to cache model β€” because it is too large, we do not want to reload it every time
# use allow_output_mutation = True to tell streamlit that model should be treated as immutable object β€” singleton
# @st.cache(allow_output_mutation = True)
# load model and tokenizer
tokenizer = transformers.AutoTokenizer.from_pretrained("yeshpanovrustem/xlm-roberta-large-ner-kazakh")
model = transformers.AutoModelForTokenClassification.from_pretrained("yeshpanovrustem/xlm-roberta-large-ner-kazakh")
# # define function for ner
# st.markdown("# Hello")
# # st.set_page_config(page_title = "Kazakh Named Entity Recognition", page_icon = "πŸ”")
# # st.title("πŸ” Kazakh Named Entity Recognition")
# x = st.slider('Select a value')
# st.write(x, 'squared is', x * x)