ai4u / cantonPOS.py
yksir's picture
Update cantonPOS.py
8926b37 verified
raw
history blame contribute delete
394 Bytes
import streamlit as st
from transformers import pipeline
# Load the POS model
model_name = "AlienKevin/bert_base_cantonese_pos_hkcancor"
nlp = pipeline("ner", model=model_name)
# Streamlit interface
st.title("Cantonese POS Tagging App")
input_text = st.text_area("Enter Cantonese text:")
if st.button("Tag POS"):
if input_text:
results = nlp(input_text)
st.json(results)