FakeNews_Detector / get_drive_links.py
NLong's picture
Upload 12 files
b5fb8d2 verified
#!/usr/bin/env python3
"""
Quick script to get Google Drive links for your RAG files
"""
from rag_news_manager import initialize_rag_system, get_rag_stats
def get_drive_links():
"""Get direct Google Drive links"""
print("πŸ”— Getting Google Drive Links...")
# Initialize RAG system
if not initialize_rag_system():
print("❌ Failed to initialize RAG system")
return
# Get statistics (includes folder and file IDs)
stats = get_rag_stats()
if not stats:
print("❌ Could not get RAG statistics")
return
print(f"\nπŸ“Š RAG System Statistics:")
print(f" Total entries: {stats['total_entries']}")
print(f" Real news: {stats['real_count']}")
print(f" Fake news: {stats['fake_count']}")
print(f" Average confidence: {stats['avg_confidence']:.1%}")
print(f"\nπŸ”— Google Drive Links:")
if stats['folder_id']:
folder_url = f"https://drive.google.com/drive/folders/{stats['folder_id']}"
print(f"πŸ“ RAG Folder: {folder_url}")
print(f" (Click to open in browser)")
if stats['file_id']:
file_url = f"https://drive.google.com/file/d/{stats['file_id']}/view"
print(f"πŸ“„ RAG File: {file_url}")
print(f" (Click to view the JSON data)")
print(f"\nπŸ’‘ Tips:")
print(f" - Use the folder link to browse all RAG files")
print(f" - Use the file link to view the raw JSON data")
print(f" - Run 'python view_rag_news.py' for a better interface")
if __name__ == "__main__":
get_drive_links()