Spaces:
Running
Running
| # File: backend/test_brain.py | |
| from ml_utils import predict_category | |
| # Simulate some files | |
| files_to_test = [ | |
| "Final_Exam_CS101.pdf", # Should be Quiz/Exam | |
| "Assignment_2_Physics.docx", # Should be Assignment | |
| "Week_05_Lecture_Slides.ppt", # Should be Lecture | |
| "Course_Outline_Spring_2025.pdf", # Should be Coursework | |
| "Grocery_List.txt", # Should be UNSORTED (Not relevant) | |
| "My_Resume.pdf", # Should be UNSORTED | |
| "Scan001.jpg", # Should be UNSORTED (Too vague) | |
| "abc.jpg", | |
| "HS101 Course Information Sheet", | |
| "Probability Final Exam", | |
| "MS402 Course Outline", | |
| "CS312 Lecture 2" | |
| ] | |
| print(f"{'FILENAME':<40} | {'PREDICTION':<15} | {'CONFIDENCE'}") | |
| print("-" * 70) | |
| for f in files_to_test: | |
| category, score = predict_category(f) | |
| print(f"{f:<40} | {category:<15} | {score:.2f}") |