File size: 394 Bytes
c3b8d9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)