Spaces:
Runtime error
Runtime error
Parimal Kalpande
commited on
Commit
·
eee2bf3
1
Parent(s):
209e20b
initial
Browse files- app.py +0 -1
- modules/report_generator.py +7 -3
app.py
CHANGED
|
@@ -78,7 +78,6 @@ def handle_interview_turn(user_audio, chatbot_history, current_state):
|
|
| 78 |
}
|
| 79 |
|
| 80 |
def generate_pdf_file(state):
|
| 81 |
-
# --- THIS IS THE CORRECTED LINE ---
|
| 82 |
final_data = { "name": state["name"], "type": state["interview_type"], "q_and_a": state["interview_log"] }
|
| 83 |
file_name = f"Report_{state['name']}_{datetime.datetime.now().strftime('%Y-%m-%d')}.pdf"
|
| 84 |
file_path = os.path.join(config.REPORT_FOLDER, file_name)
|
|
|
|
| 78 |
}
|
| 79 |
|
| 80 |
def generate_pdf_file(state):
|
|
|
|
| 81 |
final_data = { "name": state["name"], "type": state["interview_type"], "q_and_a": state["interview_log"] }
|
| 82 |
file_name = f"Report_{state['name']}_{datetime.datetime.now().strftime('%Y-%m-%d')}.pdf"
|
| 83 |
file_path = os.path.join(config.REPORT_FOLDER, file_name)
|
modules/report_generator.py
CHANGED
|
@@ -3,7 +3,7 @@ import datetime
|
|
| 3 |
import os
|
| 4 |
import numpy as np
|
| 5 |
import matplotlib.pyplot as plt
|
| 6 |
-
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak, Image
|
| 7 |
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
|
| 8 |
from reportlab.lib.enums import TA_JUSTIFY, TA_CENTER
|
| 9 |
from reportlab.lib.units import inch
|
|
@@ -11,8 +11,12 @@ from reportlab.lib import colors
|
|
| 11 |
from modules.llm_handler import generate_holistic_feedback, parse_scores_from_evaluation
|
| 12 |
import config
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
def create_radar_chart(labels, scores, file_path):
|
| 15 |
-
"""Generates and saves a radar chart as a PNG image."""
|
| 16 |
num_vars = len(labels)
|
| 17 |
angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()
|
| 18 |
scores += scores[:1]
|
|
@@ -42,7 +46,7 @@ def generate_pdf_report(interview_data, file_path):
|
|
| 42 |
story.append(Paragraph("Overall Performance Analysis", styles['h1']))
|
| 43 |
full_log_text = ""
|
| 44 |
all_scores = []
|
| 45 |
-
skill_labels = ['
|
| 46 |
|
| 47 |
for i, qa in enumerate(interview_data['q_and_a']):
|
| 48 |
full_log_text += f"Q{i+1}: {qa['question']}\nA: {qa['answer']}\n---\n"
|
|
|
|
| 3 |
import os
|
| 4 |
import numpy as np
|
| 5 |
import matplotlib.pyplot as plt
|
| 6 |
+
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak, Image
|
| 7 |
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
|
| 8 |
from reportlab.lib.enums import TA_JUSTIFY, TA_CENTER
|
| 9 |
from reportlab.lib.units import inch
|
|
|
|
| 11 |
from modules.llm_handler import generate_holistic_feedback, parse_scores_from_evaluation
|
| 12 |
import config
|
| 13 |
|
| 14 |
+
def define_skill_areas(interview_type):
|
| 15 |
+
if interview_type == 'Technical':
|
| 16 |
+
return ['Factual Accuracy', 'Structure & Clarity', 'Relevance & Directness']
|
| 17 |
+
return ['Factual Accuracy', 'Relevance & Directness', 'Structure & Clarity']
|
| 18 |
+
|
| 19 |
def create_radar_chart(labels, scores, file_path):
|
|
|
|
| 20 |
num_vars = len(labels)
|
| 21 |
angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()
|
| 22 |
scores += scores[:1]
|
|
|
|
| 46 |
story.append(Paragraph("Overall Performance Analysis", styles['h1']))
|
| 47 |
full_log_text = ""
|
| 48 |
all_scores = []
|
| 49 |
+
skill_labels = define_skill_areas(interview_data['type'])
|
| 50 |
|
| 51 |
for i, qa in enumerate(interview_data['q_and_a']):
|
| 52 |
full_log_text += f"Q{i+1}: {qa['question']}\nA: {qa['answer']}\n---\n"
|