Spaces:
Sleeping
Sleeping
xxxxxx
commited on
Commit
·
32f9de4
1
Parent(s):
8bb6322
update
Browse files
app.py
CHANGED
@@ -57,14 +57,14 @@ with col1:
|
|
57 |
# 创建文本输入框
|
58 |
text_input = st.text_area("请输入中文文本:", height=200)
|
59 |
|
60 |
-
if st.button("
|
61 |
if text_input:
|
62 |
with st.spinner("正在分析..."):
|
63 |
results = classify_text(text_input)
|
64 |
|
65 |
for model, result in results.items():
|
66 |
st.subheader(f"{model.upper()} 模型分类结果:")
|
67 |
-
label = "垃圾信息" if result["label"] == "
|
68 |
if label == "垃圾信息":
|
69 |
st.error(f"⚠️ {label}")
|
70 |
else:
|
|
|
57 |
# 创建文本输入框
|
58 |
text_input = st.text_area("请输入中文文本:", height=200)
|
59 |
|
60 |
+
if st.button("分析", key="classify_button"):
|
61 |
if text_input:
|
62 |
with st.spinner("正在分析..."):
|
63 |
results = classify_text(text_input)
|
64 |
|
65 |
for model, result in results.items():
|
66 |
st.subheader(f"{model.upper()} 模型分类结果:")
|
67 |
+
label = "垃圾信息" if result["label"] == "spam" else "正常信息"
|
68 |
if label == "垃圾信息":
|
69 |
st.error(f"⚠️ {label}")
|
70 |
else:
|