File size: 700 Bytes
e830305
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import streamlit as st
from agent import classify_emoji_text

st.set_page_config(page_title="Emoji Offensive Classifier", page_icon="🤖")
st.title("🧠 Emoji Offensive Text Detector")

st.markdown("Enter a sentence containing emoji and check if it’s offensive.")

example = "你是🐷"
text = st.text_area("Enter text:", value=example, height=100)

if st.button("Analyze"):
    with st.spinner("Processing..."):
        translated, label, score = classify_emoji_text(text)
        st.markdown(f"**Translated Text:** `{translated}`")
        st.markdown(f"**Prediction:** `{label}`")
        st.markdown(f"**Confidence:** `{score:.2%}`")
else:
    st.info("Click the button to start analysis.")