NLong commited on
Commit
0af1f17
·
verified ·
1 Parent(s): dcf628b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -16
app.py CHANGED
@@ -714,33 +714,54 @@ def analyze_news(news_text):
714
  def create_interface():
715
  with gr.Blocks(title="Vietnamese Fake News Detection System", theme=gr.themes.Soft()) as interface:
716
  gr.Markdown("""
717
- # Vietnamese Fake News Detection System
718
- ## Powered by Google Search + Gemini AI + DistilBERT
719
-
720
- **Hệ thống phát hiện tin giả tiếng Việt sử dụng 3 công cụ mạnh mẽ:**
721
- - **Google Search**: Tìm kiếm thông tin thực tế
722
- - **Gemini AI**: Phân tích thông minh
723
- - **DistilBERT**: hình AI được huấn luyện đặc biệt cho tiếng Việt
724
-
725
- **Lưu ý**: Kết quả có thể thay đổi nhẹ giữa các lần phân tích do tính chất AI của Gemini, nhưng độ chính xác tổng thể vẫn được đảm bảo.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
726
  """)
727
 
728
  with gr.Row():
729
  with gr.Column(scale=2):
 
730
  news_input = gr.Textbox(
731
- label="Tin tức cần phân tích",
732
  placeholder="Nhập tin tức tiếng Việt cần kiểm tra...",
733
- lines=4
 
734
  )
735
 
736
- analyze_btn = gr.Button(" Phân tích với AI nâng cao", variant="primary", size="lg")
737
 
738
  with gr.Column(scale=1, visible=False) as results_column:
739
- gr.Markdown("### Kết quả phân tích")
740
- real_confidence = gr.Label("Độ chắc chắn là tin thật", value="Độ chắc chắn là tin thật: 0%")
741
- fake_confidence = gr.Label("Độ chắc chắn là tin giả", value="Độ chắc chắn là tin giả: 0%")
742
 
743
- detailed_analysis = gr.Markdown("### Phân tích chi tiết sẽ hiển thị ở đây...", visible=False)
744
 
745
  # Event handlers
746
  analyze_btn.click(
 
714
  def create_interface():
715
  with gr.Blocks(title="Vietnamese Fake News Detection System", theme=gr.themes.Soft()) as interface:
716
  gr.Markdown("""
717
+ <div style="text-align: center; padding: 20px;">
718
+ <h1 style="color: #2c3e50; margin-bottom: 10px;">🔍 Vietnamese Fake News Detection System</h1>
719
+ <p style="color: #7f8c8d; font-size: 16px; margin-bottom: 30px;">Powered by Google Search + Gemini AI + DistilBERT</p>
720
+
721
+ <div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px; border-radius: 15px; margin: 20px 0;">
722
+ <h3 style="margin: 0 0 15px 0;">🛡️ Hệ thống phát hiện tin giả tiếng Việt</h3>
723
+ <div style="display: flex; justify-content: space-around; flex-wrap: wrap; gap: 15px;">
724
+ <div style="text-align: center;">
725
+ <div style="font-size: 24px; margin-bottom: 5px;">🌐</div>
726
+ <strong>Google Search</strong><br>
727
+ <small>Tìm kiếm thông tin thực tế</small>
728
+ </div>
729
+ <div style="text-align: center;">
730
+ <div style="font-size: 24px; margin-bottom: 5px;">🧠</div>
731
+ <strong>Gemini AI</strong><br>
732
+ <small>Phân tích thông minh</small>
733
+ </div>
734
+ <div style="text-align: center;">
735
+ <div style="font-size: 24px; margin-bottom: 5px;">🤖</div>
736
+ <strong>DistilBERT</strong><br>
737
+ <small>AI chuyên tiếng Việt</small>
738
+ </div>
739
+ </div>
740
+ </div>
741
+
742
+ <div style="background: #f8f9fa; padding: 15px; border-radius: 10px; border-left: 4px solid #17a2b8; margin: 20px 0;">
743
+ <p style="margin: 0; color: #495057;"><strong>💡 Lưu ý:</strong> Kết quả có thể thay đổi nhẹ giữa các lần phân tích do tính chất AI của Gemini, nhưng độ chính xác tổng thể vẫn được đảm bảo.</p>
744
+ </div>
745
+ </div>
746
  """)
747
 
748
  with gr.Row():
749
  with gr.Column(scale=2):
750
+ gr.Markdown("### 📝 Nhập tin tức cần kiểm tra")
751
  news_input = gr.Textbox(
 
752
  placeholder="Nhập tin tức tiếng Việt cần kiểm tra...",
753
+ lines=4,
754
+ show_label=False
755
  )
756
 
757
+ analyze_btn = gr.Button("🔍 Phân tích với AI nâng cao", variant="primary", size="lg")
758
 
759
  with gr.Column(scale=1, visible=False) as results_column:
760
+ gr.Markdown("### 📊 Kết quả phân tích")
761
+ real_confidence = gr.Label(value="Độ chắc chắn là tin thật: 0%")
762
+ fake_confidence = gr.Label(value="Độ chắc chắn là tin giả: 0%")
763
 
764
+ detailed_analysis = gr.Markdown("### 📋 Phân tích chi tiết sẽ hiển thị ở đây...", visible=False)
765
 
766
  # Event handlers
767
  analyze_btn.click(