-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_analysis.py
More file actions
66 lines (51 loc) · 1.76 KB
/
Copy pathdebug_analysis.py
File metadata and controls
66 lines (51 loc) · 1.76 KB
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
57
58
59
60
61
62
63
64
65
66
import os
import django
from django.conf import settings
# Setup Django environment
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rank_my_cv.settings')
django.setup()
from apps.analyzer.services.scorer import ScoringEngine
def test_scorer():
print("--- Starting Scorer Debug ---")
# Mock Data
resume_data = {
'full_text': """
Raghav Desai
Software Engineer
EXPERIENCE
Senior Developer at Tech Corp
- Used Python and Django to build web apps.
- Implemented REST APIs.
SKILLS
Python, Django, JavaScript, AWS
""",
'sections': {
'experience': 'Senior Developer at Tech Corp\n- Used Python and Django to build web apps.',
'skills': 'Python, Django, JavaScript, AWS'
}
}
jd_text = """
We are looking for a Python Developer.
Must have experience with Django and REST APIs.
Knowledge of AWS is a plus.
"""
engine = ScoringEngine()
try:
results = engine.analyze(resume_data, jd_text)
print("\n--- Analysis Result Keys ---")
print(results.keys())
print("\n--- Details Section ---")
print(results.get('details', 'MISSING'))
if 'details' in results:
print("\n--- Keywords Detail ---")
print(results['details'].get('keywords', 'MISSING_KEYWORDS'))
print("\n--- Final Score ---")
print(results.get('final_score'))
print("\n--- AI Analysis ---")
print(results.get('ai_analysis'))
except Exception as e:
print(f"\nCRITICAL ERROR: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
test_scorer()