Spaces:
Running
Running
| #!/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() | |