shukdevdatta123 commited on
Commit
66dd8ef
Β·
verified Β·
1 Parent(s): 71e1e5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +266 -166
app.py CHANGED
@@ -136,19 +136,26 @@ def analyze_phishing(content):
136
 
137
  return classification, confidence, analysis, inference_time
138
 
139
- def batch_analyze(file_content):
140
  """
141
  Batch analysis function for file upload
142
 
143
  Args:
144
- file_content (str): File content with one URL/text per line
145
 
146
  Returns:
147
  str: Formatted results
148
  """
149
- if not file_content:
150
  return "Please upload a file with content to analyze (one item per line)"
151
 
 
 
 
 
 
 
 
152
  lines = [line.strip() for line in file_content.split('\n') if line.strip()]
153
 
154
  if not lines:
@@ -262,7 +269,7 @@ examples = [
262
 
263
  # Cryptocurrency/Investment Scams
264
  ["Make $10,000 per day with Bitcoin! Limited time offer - invest now: bitcoin-millionaire.crypto-scam.org"],
265
- ["Elon Musk is giving away FREE cryptocurrency! Claim yours now: musk-crypto-giveaway.fake-tesla.com"],
266
  ["Join our exclusive trading group. 1000% returns guaranteed: forex-millionaire.trading-scam.net"],
267
 
268
  # Fake Government/Authority Messages
@@ -338,13 +345,33 @@ examples = [
338
  ["I lost 100 pounds without diet or exercise! Here's my secret: weight-loss-secret.fitness-fraud.net"]
339
  ]
340
 
341
- # Create Gradio interface
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  with gr.Blocks(
343
  title="πŸ” PhishGuard AI - Advanced Phishing Detection",
344
- theme=gr.themes.Soft(),
345
  css="""
346
  .gradio-container {
347
  max-width: 1400px !important;
 
348
  }
349
  .title {
350
  text-align: center;
@@ -366,183 +393,218 @@ with gr.Blocks(
366
  border: 2px solid #e1e5e9;
367
  border-radius: 10px;
368
  padding: 1em;
369
- margin: 0.5em;
370
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
371
  }
372
  """
373
  ) as app:
374
 
375
  gr.HTML("""
376
- <div class="title">πŸ” PhishGuard AI</div>
377
- <div class="subtitle">
378
- πŸš€ Advanced AI-Powered Phishing Detection System<br>
379
- Analyze URLs, emails, SMS messages, and social content for sophisticated threats
 
 
380
  </div>
381
  """)
382
 
383
  with gr.Tabs():
384
  # Single Analysis Tab
385
  with gr.TabItem("πŸ” Single Analysis", elem_id="single-analysis"):
386
- gr.Markdown("### 🎯 Analyze Individual Content")
387
- gr.Markdown("Paste any suspicious URL, email, SMS, or text content below for instant AI analysis")
388
-
389
- with gr.Row():
390
- with gr.Column(scale=2):
391
- input_text = gr.Textbox(
392
- label="πŸ“ Enter Content to Analyze",
393
- placeholder="Examples: URLs, email content, SMS messages, social media posts, or any suspicious text...",
394
- lines=4,
395
- max_lines=12
396
- )
 
 
 
 
 
397
 
398
- with gr.Row():
399
- analyze_btn = gr.Button("πŸ” Analyze Content", variant="primary", size="lg")
400
- clear_btn = gr.Button("πŸ—‘οΈ Clear", variant="secondary")
 
 
401
 
402
- with gr.Column(scale=1):
403
- with gr.Group():
404
- classification_output = gr.Textbox(label="🎯 Classification", interactive=False)
405
- confidence_output = gr.Textbox(label="πŸ“Š Confidence Level", interactive=False)
406
- time_output = gr.Textbox(label="⚑ Analysis Time", interactive=False)
407
-
408
- analysis_output = gr.Textbox(
409
- label="πŸ”¬ Detailed AI Analysis",
410
- lines=10,
411
- max_lines=20,
412
- interactive=False,
413
- placeholder="Detailed analysis will appear here..."
414
- )
415
-
416
- # Enhanced Examples section with categories
417
- gr.Markdown("### πŸ“š Comprehensive Test Examples")
418
- gr.Markdown("Try these diverse examples to explore the AI's detection capabilities:")
419
-
420
- with gr.Accordion("🏦 Banking & Finance", open=False):
421
- gr.Examples(
422
- examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['paypal', 'bank', 'chase', 'credit', 'wellsfargo', 'visa'])],
423
- inputs=[input_text],
424
- outputs=[classification_output, confidence_output, analysis_output, time_output],
425
- fn=analyze_phishing,
426
- cache_examples=False
427
- )
428
-
429
- with gr.Accordion("πŸ›’ E-commerce & Shopping", open=False):
430
- gr.Examples(
431
- examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['amazon', 'ebay', 'apple', 'microsoft', 'netflix'])],
432
- inputs=[input_text],
433
- outputs=[classification_output, confidence_output, analysis_output, time_output],
434
- fn=analyze_phishing,
435
- cache_examples=False
436
- )
437
-
438
- with gr.Accordion("πŸ“§ Email Scams", open=False):
439
- gr.Examples(
440
- examples=[ex for ex in examples if len(ex[0]) > 100 and any(keyword in ex[0].lower() for keyword in ['urgent', 'congratulations', 'won', 'grant', 'lottery'])],
441
- inputs=[input_text],
442
- outputs=[classification_output, confidence_output, analysis_output, time_output],
443
- fn=analyze_phishing,
444
- cache_examples=False
445
- )
446
-
447
- with gr.Accordion("πŸ“± SMS & Text Messages", open=False):
448
- gr.Examples(
449
- examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['alert', 'package', 'verification', 'expires', 'code'])],
450
- inputs=[input_text],
451
- outputs=[classification_output, confidence_output, analysis_output, time_output],
452
- fn=analyze_phishing,
453
- cache_examples=False
454
- )
455
-
456
- with gr.Accordion("πŸ’» Tech Support Scams", open=False):
457
- gr.Examples(
458
- examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['virus', 'infected', 'security warning', 'update required', 'antivirus'])],
459
- inputs=[input_text],
460
- outputs=[classification_output, confidence_output, analysis_output, time_output],
461
- fn=analyze_phishing,
462
- cache_examples=False
463
- )
464
-
465
- with gr.Accordion("πŸ’° Investment & Crypto Scams", open=False):
466
- gr.Examples(
467
- examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['bitcoin', 'crypto', 'investment', 'trading', 'returns'])],
468
- inputs=[input_text],
469
- outputs=[classification_output, confidence_output, analysis_output, time_output],
470
- fn=analyze_phishing,
471
- cache_examples=False
472
- )
473
-
474
- with gr.Accordion("πŸ’Ό Job & Employment Scams", open=False):
475
- gr.Examples(
476
- examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['work from home', 'job', 'employment', 'mystery shopper', 'remote'])],
477
- inputs=[input_text],
478
- outputs=[classification_output, confidence_output, analysis_output, time_output],
479
- fn=analyze_phishing,
480
- cache_examples=False
481
- )
482
-
483
- with gr.Accordion("βœ… Legitimate Content Examples", open=False):
484
- gr.Examples(
485
- examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['thank you', 'receipt', 'appointment', 'order confirmation', 'welcome'])],
486
- inputs=[input_text],
487
- outputs=[classification_output, confidence_output, analysis_output, time_output],
488
- fn=analyze_phishing,
489
- cache_examples=False
490
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
 
492
  # Batch Analysis Tab
493
  with gr.TabItem("πŸ“Š Batch Analysis"):
494
- gr.Markdown("### πŸ“¦ Analyze Multiple Items at Once")
495
- gr.Markdown("Upload a text file with one URL, email, or content per line for bulk analysis")
496
-
497
- with gr.Row():
498
- with gr.Column():
499
- file_input = gr.File(
500
- label="πŸ“ Upload Text File (.txt)",
501
- file_types=[".txt"],
502
- type="text"
503
- )
504
-
505
- batch_btn = gr.Button("πŸ“Š Analyze Batch", variant="primary", size="lg")
506
-
507
- gr.Markdown("""
508
- **πŸ“‹ File Format:**
509
- - One item per line
510
- - Supports URLs, emails, SMS content
511
- - Maximum 100 items per batch
512
- - Plain text format (.txt)
513
- """)
514
-
515
- batch_output = gr.Markdown(label="πŸ“ˆ Batch Analysis Results")
 
516
 
517
  # Real-time Monitoring Tab
518
  with gr.TabItem("⚑ Quick Test"):
519
- gr.Markdown("### πŸš€ Quick Phishing Detection Test")
520
- gr.Markdown("Instantly test common phishing scenarios with pre-loaded examples")
521
-
522
- with gr.Row():
523
- with gr.Column():
524
- gr.Markdown("#### 🚨 Suspicious Content")
525
- suspicious_examples = [
526
- "Urgent: Your account will be suspended in 24 hours! Verify now: secure-verification.fake-bank.com",
527
- "Congratulations! You've won $10,000! Claim immediately: lottery-winner.scam-site.org",
528
- "Apple ID locked due to suspicious activity. Unlock now: apple-security.phishing-domain.net"
529
- ]
530
-
531
- for i, example in enumerate(suspicious_examples):
532
- if gr.Button(f"Test Suspicious #{i+1}", variant="stop"):
533
- input_text.value = example
534
 
535
- with gr.Column():
536
- gr.Markdown("#### βœ… Legitimate Content")
537
- legitimate_examples = [
538
- "Your monthly statement is ready for download on our secure banking portal.",
539
- "Thank you for your purchase. Your order will ship within 2-3 business days.",
540
- "Appointment reminder: Your doctor's appointment is scheduled for tomorrow at 2 PM."
541
- ]
542
 
543
- for i, example in enumerate(legitimate_examples):
544
- if gr.Button(f"Test Legitimate #{i+1}", variant="primary"):
545
- input_text.value = example
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
 
547
  # Statistics & Insights Tab
548
  with gr.TabItem("πŸ“ˆ Insights"):
@@ -679,14 +741,52 @@ with gr.Blocks(
679
  inputs=[file_input],
680
  outputs=[batch_output]
681
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
 
683
  # Launch the app
684
  if __name__ == "__main__":
685
  app.launch(
686
- server_name="0.0.0.0",
687
- server_port=7860,
688
- show_error=True,
689
- share=False,
690
- favicon_path=None,
691
- show_tips=True
692
  )
 
136
 
137
  return classification, confidence, analysis, inference_time
138
 
139
+ def batch_analyze(file_path):
140
  """
141
  Batch analysis function for file upload
142
 
143
  Args:
144
+ file_path (str): Path to uploaded file
145
 
146
  Returns:
147
  str: Formatted results
148
  """
149
+ if not file_path:
150
  return "Please upload a file with content to analyze (one item per line)"
151
 
152
+ try:
153
+ # Read the file content
154
+ with open(file_path, 'r', encoding='utf-8') as f:
155
+ file_content = f.read()
156
+ except Exception as e:
157
+ return f"Error reading file: {str(e)}"
158
+
159
  lines = [line.strip() for line in file_content.split('\n') if line.strip()]
160
 
161
  if not lines:
 
269
 
270
  # Cryptocurrency/Investment Scams
271
  ["Make $10,000 per day with Bitcoin! Limited time offer - invest now: bitcoin-millionaire.crypto-scam.org"],
272
+ ["Elon Musk is giving750 giving away FREE cryptocurrency! Claim yours now: musk-crypto-giveaway.fake-tesla.com"],
273
  ["Join our exclusive trading group. 1000% returns guaranteed: forex-millionaire.trading-scam.net"],
274
 
275
  # Fake Government/Authority Messages
 
345
  ["I lost 100 pounds without diet or exercise! Here's my secret: weight-loss-secret.fitness-fraud.net"]
346
  ]
347
 
348
+ # Quick test button functions
349
+ def set_suspicious_1():
350
+ return "Urgent: Your account will be suspended in 24 hours! Verify now: secure-verification.fake-bank.com"
351
+
352
+ def set_suspicious_2():
353
+ return "Congratulations! You've won $10,000! Claim immediately: lottery-winner.scam-site.org"
354
+
355
+ def set_suspicious_3():
356
+ return "Apple ID locked due to suspicious activity. Unlock now: apple-security.phishing-domain.net"
357
+
358
+ def set_legitimate_1():
359
+ return "Your monthly statement is ready for download on our secure banking portal."
360
+
361
+ def set_legitimate_2():
362
+ return "Thank you for your purchase. Your order will ship within 2-3 business days."
363
+
364
+ def set_legitimate_3():
365
+ return "Appointment reminder: Your doctor's appointment is scheduled for tomorrow at 2 PM."
366
+
367
+ # Create Gradio interface with center alignment
368
  with gr.Blocks(
369
  title="πŸ” PhishGuard AI - Advanced Phishing Detection",
370
+ theme=gr.themes.Ocean(),
371
  css="""
372
  .gradio-container {
373
  max-width: 1400px !important;
374
+ margin: 0 auto !important;
375
  }
376
  .title {
377
  text-align: center;
 
393
  border: 2px solid #e1e5e9;
394
  border-radius: 10px;
395
  padding: 1em;
396
+ margin: 0.5em auto;
397
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
398
+ text-align: center;
399
+ }
400
+ .container {
401
+ text-align: center;
402
+ }
403
+ .main-content {
404
+ margin: 0 auto;
405
+ padding: 20px;
406
+ }
407
+ .tab-nav {
408
+ justify-content: center;
409
+ }
410
+ .gradio-row {
411
+ justify-content: center;
412
+ }
413
+ .gradio-column {
414
+ display: flex;
415
+ flex-direction: column;
416
+ align-items: center;
417
  }
418
  """
419
  ) as app:
420
 
421
  gr.HTML("""
422
+ <div class="container">
423
+ <div class="title">πŸ” PhishGuard AI</div>
424
+ <div class="subtitle">
425
+ πŸš€ Advanced AI-Powered Phishing Detection System<br>
426
+ Analyze URLs, emails, SMS messages, and social content for sophisticated threats
427
+ </div>
428
  </div>
429
  """)
430
 
431
  with gr.Tabs():
432
  # Single Analysis Tab
433
  with gr.TabItem("πŸ” Single Analysis", elem_id="single-analysis"):
434
+ with gr.Column(elem_classes=["main-content"]):
435
+ gr.Markdown("### 🎯 Analyze Individual Content", elem_classes=["container"])
436
+ gr.Markdown("Paste any suspicious URL, email, SMS, or text content below for instant AI analysis", elem_classes=["container"])
437
+
438
+ with gr.Row():
439
+ with gr.Column(scale=2):
440
+ input_text = gr.Textbox(
441
+ label="πŸ“ Enter Content to Analyze",
442
+ placeholder="Examples: URLs, email content, SMS messages, social media posts, or any suspicious text...",
443
+ lines=4,
444
+ max_lines=12
445
+ )
446
+
447
+ with gr.Row():
448
+ analyze_btn = gr.Button("πŸ” Analyze Content", variant="primary", size="lg")
449
+ clear_btn = gr.Button("πŸ—‘οΈ Clear", variant="secondary")
450
 
451
+ with gr.Column(scale=1):
452
+ with gr.Group():
453
+ classification_output = gr.Textbox(label="🎯 Classification", interactive=False)
454
+ confidence_output = gr.Textbox(label="πŸ“Š Confidence Level", interactive=False)
455
+ time_output = gr.Textbox(label="⚑ Analysis Time", interactive=False)
456
 
457
+ analysis_output = gr.Textbox(
458
+ label="πŸ”¬ Detailed AI Analysis",
459
+ lines=10,
460
+ max_lines=20,
461
+ interactive=False,
462
+ placeholder="Detailed analysis will appear here..."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
463
  )
464
+
465
+ # Enhanced Examples section with categories
466
+ gr.Markdown("### πŸ“š Comprehensive Test Examples", elem_classes=["container"])
467
+ gr.Markdown("Try these diverse examples to explore the AI's detection capabilities:", elem_classes=["container"])
468
+
469
+ with gr.Accordion("🏦 Banking & Finance", open=False):
470
+ gr.Examples(
471
+ examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['paypal', 'bank', 'chase', 'credit', 'wellsfargo', 'visa'])],
472
+ inputs=[input_text],
473
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
474
+ fn=analyze_phishing,
475
+ cache_examples=False
476
+ )
477
+
478
+ with gr.Accordion("πŸ›’ E-commerce & Shopping", open=False):
479
+ gr.Examples(
480
+ examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['amazon', 'ebay', 'apple', 'microsoft', 'netflix'])],
481
+ inputs=[input_text],
482
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
483
+ fn=analyze_phishing,
484
+ cache_examples=False
485
+ )
486
+
487
+ with gr.Accordion("πŸ“§ Email Scams", open=False):
488
+ gr.Examples(
489
+ examples=[ex for ex in examples if len(ex[0]) > 100 and any(keyword in ex[0].lower() for keyword in ['urgent', 'congratulations', 'won', 'grant', 'lottery'])],
490
+ inputs=[input_text],
491
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
492
+ fn=analyze_phishing,
493
+ cache_examples=False
494
+ )
495
+
496
+ with gr.Accordion("πŸ“± SMS & Text Messages", open=False):
497
+ gr.Examples(
498
+ examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['alert', 'package', 'verification', 'expires', 'code'])],
499
+ inputs=[input_text],
500
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
501
+ fn=analyze_phishing,
502
+ cache_examples=False
503
+ )
504
+
505
+ with gr.Accordion("πŸ’» Tech Support Scams", open=False):
506
+ gr.Examples(
507
+ examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['virus', 'infected', 'security warning', 'update required', 'antivirus'])],
508
+ inputs=[input_text],
509
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
510
+ fn=analyze_phishing,
511
+ cache_examples=False
512
+ )
513
+
514
+ with gr.Accordion("πŸ’° Investment & Crypto Scams", open=False):
515
+ gr.Examples(
516
+ examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['bitcoin', 'crypto', 'investment', 'trading', 'returns'])],
517
+ inputs=[input_text],
518
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
519
+ fn=analyze_phishing,
520
+ cache_examples=False
521
+ )
522
+
523
+ with gr.Accordion("πŸ’Ό Job & Employment Scams", open=False):
524
+ gr.Examples(
525
+ examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['work from home', 'job', 'employment', 'mystery shopper', 'remote'])],
526
+ inputs=[input_text],
527
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
528
+ fn=analyze_phishing,
529
+ cache_examples=False
530
+ )
531
+
532
+ with gr.Accordion("βœ… Legitimate Content Examples", open=False):
533
+ gr.Examples(
534
+ examples=[ex for ex in examples if any(keyword in ex[0].lower() for keyword in ['thank you', 'receipt', 'appointment', 'order confirmation', 'welcome'])],
535
+ inputs=[input_text],
536
+ outputs=[classification_output, confidence_output, analysis_output, time_output],
537
+ fn=analyze_phishing,
538
+ cache_examples=False
539
+ )
540
 
541
  # Batch Analysis Tab
542
  with gr.TabItem("πŸ“Š Batch Analysis"):
543
+ with gr.Column(elem_classes=["main-content"]):
544
+ gr.Markdown("### πŸ“¦ Analyze Multiple Items at Once", elem_classes=["container"])
545
+ gr.Markdown("Upload a text file with one URL, email, or content per line for bulk analysis", elem_classes=["container"])
546
+
547
+ with gr.Row():
548
+ with gr.Column():
549
+ file_input = gr.File(
550
+ label="πŸ“ Upload Text File (.txt)",
551
+ file_types=[".txt"],
552
+ type="filepath"
553
+ )
554
+
555
+ batch_btn = gr.Button("πŸ“Š Analyze Batch", variant="primary", size="lg")
556
+
557
+ gr.Markdown("""
558
+ **πŸ“‹ File Format:**
559
+ - One item per line
560
+ - Supports URLs, emails, SMS content
561
+ - Maximum 100 items per batch
562
+ - Plain text format (.txt)
563
+ """, elem_classes=["container"])
564
+
565
+ batch_output = gr.Markdown(label="πŸ“ˆ Batch Analysis Results")
566
 
567
  # Real-time Monitoring Tab
568
  with gr.TabItem("⚑ Quick Test"):
569
+ with gr.Column(elem_classes=["main-content"]):
570
+ gr.Markdown("### πŸš€ Quick Phishing Detection Test", elem_classes=["container"])
571
+ gr.Markdown("Instantly test common phishing scenarios with pre-loaded examples", elem_classes=["container"])
 
 
 
 
 
 
 
 
 
 
 
 
572
 
573
+ with gr.Row():
574
+ with gr.Column():
575
+ gr.Markdown("#### 🚨 Test Suspicious Content", elem_classes=["container"])
576
+ suspicious_btn1 = gr.Button("🚨 Test: Fake Bank Alert", variant="stop")
577
+ suspicious_btn2 = gr.Button("🚨 Test: Lottery Scam", variant="stop")
578
+ suspicious_btn3 = gr.Button("🚨 Test: Apple ID Phishing", variant="stop")
 
579
 
580
+ with gr.Column():
581
+ gr.Markdown("#### βœ… Test Legitimate Content", elem_classes=["container"])
582
+ legitimate_btn1 = gr.Button("βœ… Test: Bank Statement", variant="primary")
583
+ legitimate_btn2 = gr.Button("βœ… Test: Order Confirmation", variant="primary")
584
+ legitimate_btn3 = gr.Button("βœ… Test: Appointment Reminder", variant="primary")
585
+
586
+ with gr.Row():
587
+ with gr.Column(scale=2):
588
+ quick_input = gr.Textbox(
589
+ label="πŸ“ Quick Test Content",
590
+ placeholder="Content from quick test buttons will appear here...",
591
+ lines=3
592
+ )
593
+
594
+ quick_analyze_btn = gr.Button("πŸ” Analyze Quick Test", variant="primary", size="lg")
595
+
596
+ with gr.Row():
597
+ with gr.Column():
598
+ quick_classification = gr.Textbox(label="🎯 Classification", interactive=False)
599
+ quick_confidence = gr.Textbox(label="πŸ“Š Confidence", interactive=False)
600
+ quick_time = gr.Textbox(label="⚑ Time", interactive=False)
601
+
602
+ quick_analysis = gr.Textbox(
603
+ label="πŸ”¬ Quick Analysis Results",
604
+ lines=8,
605
+ interactive=False,
606
+ placeholder="Analysis results will appear here..."
607
+ )
608
 
609
  # Statistics & Insights Tab
610
  with gr.TabItem("πŸ“ˆ Insights"):
 
741
  inputs=[file_input],
742
  outputs=[batch_output]
743
  )
744
+
745
+ # Quick Test tab event handlers
746
+ suspicious_btn1.click(
747
+ fn=set_suspicious_1,
748
+ inputs=[],
749
+ outputs=quick_input
750
+ )
751
+
752
+ suspicious_btn2.click(
753
+ fn=set_suspicious_2,
754
+ inputs=[],
755
+ outputs=quick_input
756
+ )
757
+
758
+ suspicious_btn3.click(
759
+ fn=set_suspicious_3,
760
+ inputs=[],
761
+ outputs=quick_input
762
+ )
763
+
764
+ legitimate_btn1.click(
765
+ fn=set_legitimate_1,
766
+ inputs=[],
767
+ outputs=quick_input
768
+ )
769
+
770
+ legitimate_btn2.click(
771
+ fn=set_legitimate_2,
772
+ inputs=[],
773
+ outputs=quick_input
774
+ )
775
+
776
+ legitimate_btn3.click(
777
+ fn=set_legitimate_3,
778
+ inputs=[],
779
+ outputs=quick_input
780
+ )
781
+
782
+ quick_analyze_btn.click(
783
+ fn=analyze_phishing,
784
+ inputs=[quick_input],
785
+ outputs=[quick_classification, quick_confidence, quick_analysis, quick_time]
786
+ )
787
 
788
  # Launch the app
789
  if __name__ == "__main__":
790
  app.launch(
791
+ share=True
 
 
 
 
 
792
  )