FakeNews_Detector / quick_check.py
NLong's picture
Upload 12 files
b5fb8d2 verified
raw
history blame
1.93 kB
#!/usr/bin/env python3
"""
Quick check to see if you have any saved RAG news
"""
from rag_news_manager import initialize_rag_system, get_rag_stats
def quick_check():
"""Quick check for saved news"""
print("πŸ” Quick RAG System Check")
print("=" * 30)
# Initialize RAG system
if not initialize_rag_system():
print("❌ RAG system not initialized")
print("πŸ’‘ Run: python setup_google_drive_rag.py")
return
# Get statistics
stats = get_rag_stats()
if not stats:
print("❌ Could not get statistics")
return
print(f"πŸ“Š Current Status:")
print(f" Total entries: {stats['total_entries']}")
if stats['total_entries'] == 0:
print("πŸ“­ No news entries saved yet")
print("πŸ’‘ Try analyzing some news with your app first!")
print("πŸ’‘ News with 95%+ confidence will be automatically saved")
else:
print(f"βœ… You have {stats['total_entries']} saved news entries!")
print(f" Real news: {stats['real_count']}")
print(f" Fake news: {stats['fake_count']}")
print(f" Average confidence: {stats['avg_confidence']:.1%}")
if stats['latest_entry']:
latest = stats['latest_entry']
print(f"\nπŸ“° Latest entry:")
print(f" {latest['news_text'][:80]}...")
print(f" {latest['prediction']} ({latest['gemini_confidence']:.1%})")
# Show Google Drive links
if stats['folder_id']:
folder_url = f"https://drive.google.com/drive/folders/{stats['folder_id']}"
print(f"\nπŸ”— Google Drive Folder: {folder_url}")
if stats['file_id']:
file_url = f"https://drive.google.com/file/d/{stats['file_id']}/view"
print(f"πŸ”— Google Drive File: {file_url}")
if __name__ == "__main__":
quick_check()