yksir commited on
Commit
c3b8d9c
·
verified ·
1 Parent(s): 37fa930

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ # Load the POS model
5
+ model_name = "AlienKevin/bert_base_cantonese_pos_hkcancor"
6
+ nlp = pipeline("ner", model=model_name)
7
+
8
+ # Streamlit interface
9
+ st.title("Cantonese POS Tagging App")
10
+ input_text = st.text_area("Enter Cantonese text:")
11
+
12
+ if st.button("Tag POS"):
13
+ if input_text:
14
+ results = nlp(input_text)
15
+ st.json(results)