Spaces:
Running
Running
File size: 1,925 Bytes
b5fb8d2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
#!/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()
|