diff --git a/.gitignore b/.gitignore index 76e7681..e53edca 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ logs/ *.xlsx *.parquet !data/spam.csv - +!email_data.csv # Streamlit .streamlit/ diff --git a/email_data.csv b/email_data.csv new file mode 100644 index 0000000..3241756 --- /dev/null +++ b/email_data.csv @@ -0,0 +1,15 @@ +text +"晚上一起吃饭吗?老地方见,我六点下班" +"恭喜您获得1000元购物券!点击链接领取:http://prize123.com" +"妈,我晚上加班,不用等我吃饭了" +"您的快递已放在小区门口快递柜,取件码是3456" +"限时特惠!新款手机直降1000元,立即抢购:http://buyphone.com" +"明天下午开会,记得带好项目报告" +"信用卡账单已出,本期应还款项为1258.36元,还款日25号" +"免费领取最新款平板电脑!回复YES即可参与抽奖" +"爸,我到北京了,一切顺利,不用担心" +"双十一预售开启!全场五折起,快来选购:http://11.11.com" +"会议改到明天上午十点,地点不变" +"您的话费余额不足,请及时充值以保证正常使用" +"恭喜您成为幸运用户!点击链接领取iPhone14:http://gift888.com" +"晚上看电影吗?新上映的那部听说不错" diff --git a/models/lightgbm.joblib b/models/lightgbm.joblib index 5e7d2d0..0311ee4 100644 Binary files a/models/lightgbm.joblib and b/models/lightgbm.joblib differ diff --git a/src/streamlit_app.py b/src/streamlit_app.py index 31414aa..1121bd6 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -405,6 +405,19 @@ with col2: st.markdown(suggestion_html, unsafe_allow_html=True) + # 添加重置按钮,准备下一次测试 + st.markdown(""" +
+ """, unsafe_allow_html=True) + + if st.button("🔄 准备下一条分析", use_container_width=True): + # 重置状态,清空输入框并重新运行应用 + st.session_state.pop("single_result", None) # 如果有存储结果的状态,清除它 + # 使用空的占位符触发界面重置 + st.empty() + # 重新运行应用以确保完全重置 + st.experimental_rerun() + except Exception as e: st.markdown("""
@@ -525,6 +538,21 @@ with col2: use_container_width=True ) + # 添加重置按钮,准备下一次测试 + st.markdown(""" +
+ """, unsafe_allow_html=True) + + if st.button("🔄 准备下一次测试", use_container_width=True): + # 重置状态,清除上传文件并重置所有相关状态 + st.session_state.pop("batch_results", None) # 如果有存储结果的状态,清除它 + uploaded_file = None # 清除上传文件引用 + # 使用空的占位符触发界面重置 + st.empty() + # 重新运行应用以确保完全重置 + st.experimental_rerun() + + except Exception as e: st.markdown("""