offensive_agent / app.py
JenniferHJF's picture
Upload app.py
9413a3f verified
raw
history blame contribute delete
700 Bytes
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.")