Spaces:
Running
Running
File size: 1,640 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 |
#!/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()
|