Spaces:
Sleeping
Sleeping
Update model.py
Browse files
model.py
CHANGED
|
@@ -205,39 +205,44 @@ Confidence: **{audio_conf}%**
|
|
| 205 |
|
| 206 |
if text_label:
|
| 207 |
reasoning_lines.append(
|
|
|
|
| 208 |
f"The text expresses a {text_label.lower()} sentiment with emotion "
|
| 209 |
f"'{emotion_label}'. The topic appears related to {topic_label}."
|
| 210 |
)
|
| 211 |
# ================= IMAGE REASONING =================
|
| 212 |
if image_label:
|
| 213 |
reasoning_lines.append(
|
| 214 |
-
f"
|
|
|
|
| 215 |
"though this may be an approximate category."
|
| 216 |
)
|
| 217 |
if caption:
|
| 218 |
reasoning_lines.append(
|
| 219 |
-
f"
|
| 220 |
-
"interpretation of the
|
| 221 |
)
|
| 222 |
|
| 223 |
if audio_label:
|
| 224 |
reasoning_lines.append(
|
|
|
|
| 225 |
f"Spoken content carries a {audio_label.lower()} tone ({audio_conf}%)."
|
| 226 |
)
|
| 227 |
if text_label and audio_label:
|
| 228 |
if text_label == "POSITIVE" and audio_label == "NEGATIVE":
|
| 229 |
reasoning_lines.append(
|
| 230 |
-
"โ Cross-
|
|
|
|
| 231 |
"but the voice tone suggests negativity."
|
| 232 |
)
|
| 233 |
if text_label == "NEGATIVE" and audio_label == "POSITIVE":
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
if image_label and topic_label:
|
| 239 |
if topic_label == "technology":
|
| 240 |
reasoning_lines.append(
|
|
|
|
| 241 |
"The textual topic relates to technology, which aligns with the detected visual content."
|
| 242 |
)
|
| 243 |
|
|
|
|
| 205 |
|
| 206 |
if text_label:
|
| 207 |
reasoning_lines.append(
|
| 208 |
+
f"<b style='color:#60a5fa;'>๐ Text Analysis:</b> "
|
| 209 |
f"The text expresses a {text_label.lower()} sentiment with emotion "
|
| 210 |
f"'{emotion_label}'. The topic appears related to {topic_label}."
|
| 211 |
)
|
| 212 |
# ================= IMAGE REASONING =================
|
| 213 |
if image_label:
|
| 214 |
reasoning_lines.append(
|
| 215 |
+
f"<b style='color:#22c55e;'>๐ผ Image Analysis:</b> "
|
| 216 |
+
f"Classifier predicted '{image_label}' ({image_conf}% confidence), "
|
| 217 |
"though this may be an approximate category."
|
| 218 |
)
|
| 219 |
if caption:
|
| 220 |
reasoning_lines.append(
|
| 221 |
+
f"<b style='color:#a78bfa;'>๐ท Scene Description:</b> "
|
| 222 |
+
f"'{caption}', providing a clearer interpretation of the image."
|
| 223 |
)
|
| 224 |
|
| 225 |
if audio_label:
|
| 226 |
reasoning_lines.append(
|
| 227 |
+
f"<b style='color:#f59e0b;'>๐ Audio Tone:</b> "
|
| 228 |
f"Spoken content carries a {audio_label.lower()} tone ({audio_conf}%)."
|
| 229 |
)
|
| 230 |
if text_label and audio_label:
|
| 231 |
if text_label == "POSITIVE" and audio_label == "NEGATIVE":
|
| 232 |
reasoning_lines.append(
|
| 233 |
+
"<b style='color:#ef4444;'>โ ๏ธ Cross-Modal Conflict:</b> "
|
| 234 |
+
" the text expresses positivity "
|
| 235 |
"but the voice tone suggests negativity."
|
| 236 |
)
|
| 237 |
if text_label == "NEGATIVE" and audio_label == "POSITIVE":
|
| 238 |
+
reasoning_lines.append(
|
| 239 |
+
"<b style='color:#ef4444;'>โ Cross-Modal Conflict:</b> "
|
| 240 |
+
"Text expresses negativity while the voice tone appears positive."
|
| 241 |
+
)
|
| 242 |
if image_label and topic_label:
|
| 243 |
if topic_label == "technology":
|
| 244 |
reasoning_lines.append(
|
| 245 |
+
"<b style='color:#ef4444;'>๐ป๐ค Technology:</b> "
|
| 246 |
"The textual topic relates to technology, which aligns with the detected visual content."
|
| 247 |
)
|
| 248 |
|