Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +10 -9
index.html
CHANGED
|
@@ -3,23 +3,23 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
| 6 |
-
<title>檢測可疑訊息/圖片OCR</title>
|
| 7 |
<link rel="stylesheet" href="/static/style.css" />
|
| 8 |
</head>
|
| 9 |
<body>
|
| 10 |
<h1>檢查可疑訊息</h1>
|
| 11 |
<div class="main-container">
|
| 12 |
|
| 13 |
-
<!-- 文字
|
| 14 |
<section id="input_area" class="panel">
|
| 15 |
-
<!-- 純文字輸入 -->
|
| 16 |
<textarea id="predict_info" placeholder="請輸入內容(最多5000字)" maxlength="5000"></textarea>
|
| 17 |
<div class="button-group">
|
| 18 |
<button id="detect_button" type="button">檢測!</button>
|
| 19 |
<button id="clear_button" type="button">清除</button>
|
| 20 |
</div>
|
| 21 |
|
| 22 |
-
<!-- 圖片上傳
|
| 23 |
<div id="image_controls" style="margin-top:1rem;">
|
| 24 |
<h4>或上傳圖片進行分析:</h4>
|
| 25 |
<input type="file" id="image_upload" accept="image/*" />
|
|
@@ -27,11 +27,11 @@
|
|
| 27 |
</div>
|
| 28 |
</section>
|
| 29 |
|
| 30 |
-
<!-- 結果區塊:
|
| 31 |
<section id="output_area" class="panel">
|
| 32 |
<h2>檢測結果</h2>
|
| 33 |
|
| 34 |
-
<!-- 文字分析 -->
|
| 35 |
<p><strong>是否為詐騙訊息:</strong> <span id="is_scam">待檢測</span></p>
|
| 36 |
<p><strong>模型預測可疑度:</strong> <span id="confidence_score">待檢測</span></p>
|
| 37 |
<p><strong>可疑詞句分析:</strong></p>
|
|
@@ -39,7 +39,7 @@
|
|
| 39 |
<p>請輸入訊息並點擊「檢測!」按鈕。</p>
|
| 40 |
</div>
|
| 41 |
|
| 42 |
-
<!-- 圖片OCR結果 -->
|
| 43 |
<div id="ocr_result" style="margin-top:1rem;">
|
| 44 |
<p><strong>擷取文字:</strong> <span id="extracted_text">尚未上傳圖片</span></p>
|
| 45 |
<p><strong>是否為詐騙訊息:</strong> <span id="img_is_scam">尚未上傳圖片</span></p>
|
|
@@ -50,8 +50,8 @@
|
|
| 50 |
</div>
|
| 51 |
</div>
|
| 52 |
|
| 53 |
-
<!-- 使用者回饋
|
| 54 |
-
<section id="feedback_area" style="display:none;">
|
| 55 |
<p><strong>這筆純文字分析結果正確嗎?</strong></p>
|
| 56 |
<div class="button-group">
|
| 57 |
<button id="feedback_correct">✅ 正確</button>
|
|
@@ -63,6 +63,7 @@
|
|
| 63 |
|
| 64 |
</div>
|
| 65 |
|
|
|
|
| 66 |
<script src="/static/script.js"></script>
|
| 67 |
</body>
|
| 68 |
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
| 6 |
+
<title>檢測可疑訊息/圖片OCR 整合範例</title>
|
| 7 |
<link rel="stylesheet" href="/static/style.css" />
|
| 8 |
</head>
|
| 9 |
<body>
|
| 10 |
<h1>檢查可疑訊息</h1>
|
| 11 |
<div class="main-container">
|
| 12 |
|
| 13 |
+
<!-- 文字+圖片 檢測放在同一個 panel -->
|
| 14 |
<section id="input_area" class="panel">
|
| 15 |
+
<!-- 1. 純文字輸入區 -->
|
| 16 |
<textarea id="predict_info" placeholder="請輸入內容(最多5000字)" maxlength="5000"></textarea>
|
| 17 |
<div class="button-group">
|
| 18 |
<button id="detect_button" type="button">檢測!</button>
|
| 19 |
<button id="clear_button" type="button">清除</button>
|
| 20 |
</div>
|
| 21 |
|
| 22 |
+
<!-- 2. 圖片上傳+辨識按鈕(與文字檢測同區塊) -->
|
| 23 |
<div id="image_controls" style="margin-top:1rem;">
|
| 24 |
<h4>或上傳圖片進行分析:</h4>
|
| 25 |
<input type="file" id="image_upload" accept="image/*" />
|
|
|
|
| 27 |
</div>
|
| 28 |
</section>
|
| 29 |
|
| 30 |
+
<!-- 檢測結果區塊:文字結果 + 圖片OCR結果 + 使用者回饋 -->
|
| 31 |
<section id="output_area" class="panel">
|
| 32 |
<h2>檢測結果</h2>
|
| 33 |
|
| 34 |
+
<!-- 1. 文字分析結果 -->
|
| 35 |
<p><strong>是否為詐騙訊息:</strong> <span id="is_scam">待檢測</span></p>
|
| 36 |
<p><strong>模型預測可疑度:</strong> <span id="confidence_score">待檢測</span></p>
|
| 37 |
<p><strong>可疑詞句分析:</strong></p>
|
|
|
|
| 39 |
<p>請輸入訊息並點擊「檢測!」按鈕。</p>
|
| 40 |
</div>
|
| 41 |
|
| 42 |
+
<!-- 2. 圖片OCR結果(由後端 /analyze-image 回傳) -->
|
| 43 |
<div id="ocr_result" style="margin-top:1rem;">
|
| 44 |
<p><strong>擷取文字:</strong> <span id="extracted_text">尚未上傳圖片</span></p>
|
| 45 |
<p><strong>是否為詐騙訊息:</strong> <span id="img_is_scam">尚未上傳圖片</span></p>
|
|
|
|
| 50 |
</div>
|
| 51 |
</div>
|
| 52 |
|
| 53 |
+
<!-- 3. 使用者回饋(文字分析專用) -->
|
| 54 |
+
<section id="feedback_area" style="display:none; margin-top:1rem;">
|
| 55 |
<p><strong>這筆純文字分析結果正確嗎?</strong></p>
|
| 56 |
<div class="button-group">
|
| 57 |
<button id="feedback_correct">✅ 正確</button>
|
|
|
|
| 63 |
|
| 64 |
</div>
|
| 65 |
|
| 66 |
+
<!-- 請確保路徑正確指向 /static/script.js -->
|
| 67 |
<script src="/static/script.js"></script>
|
| 68 |
</body>
|
| 69 |
</html>
|