Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ if st.button("🚦 Analyze Text"):
|
|
78 |
|
79 |
# 图片上传与 OCR
|
80 |
st.markdown("---")
|
81 |
-
st.subheader("2.
|
82 |
uploaded_file = st.file_uploader("Upload an image (JPG/PNG)", type=["jpg","jpeg","png"])
|
83 |
if uploaded_file:
|
84 |
image = Image.open(uploaded_file)
|
@@ -119,8 +119,9 @@ if st.session_state.history:
|
|
119 |
radar_fig = px.line_polar(radar_df, r='Score', theta='Category', line_close=True, title="⚠️ Risk Radar by Category")
|
120 |
radar_fig.update_traces(line_color='black')
|
121 |
st.plotly_chart(radar_fig)
|
122 |
-
|
123 |
-
|
|
|
124 |
st.markdown("### 🧬 Word-level Offensive Correlation")
|
125 |
|
126 |
last_translated_text = st.session_state.history[-1]["translated"]
|
@@ -152,4 +153,4 @@ if st.session_state.history:
|
|
152 |
unsafe_allow_html=True
|
153 |
)
|
154 |
else:
|
155 |
-
st.info("❕ No word-level analysis available.")
|
|
|
78 |
|
79 |
# 图片上传与 OCR
|
80 |
st.markdown("---")
|
81 |
+
st.subheader("2. 图片 OCR & 分类")
|
82 |
uploaded_file = st.file_uploader("Upload an image (JPG/PNG)", type=["jpg","jpeg","png"])
|
83 |
if uploaded_file:
|
84 |
image = Image.open(uploaded_file)
|
|
|
119 |
radar_fig = px.line_polar(radar_df, r='Score', theta='Category', line_close=True, title="⚠️ Risk Radar by Category")
|
120 |
radar_fig.update_traces(line_color='black')
|
121 |
st.plotly_chart(radar_fig)
|
122 |
+
else:
|
123 |
+
st.info("⚠️ No classification data available yet.")
|
124 |
+
# 單詞冒犯性分析模塊
|
125 |
st.markdown("### 🧬 Word-level Offensive Correlation")
|
126 |
|
127 |
last_translated_text = st.session_state.history[-1]["translated"]
|
|
|
153 |
unsafe_allow_html=True
|
154 |
)
|
155 |
else:
|
156 |
+
st.info("❕ No word-level analysis available.")
|