Skip to content

Commit

Permalink
chore: cleans unused imports and useless comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hajdul88 committed Feb 7, 2025
1 parent 1b161e2 commit 8f134f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ async def question_answering_non_parallel(
for instance in questions:
query_text = instance["question"]
correct_answer = instance["answer"]
# Perform async search for the question

search_results = await cognee.search(search_type, query_text=query_text)

# Store the results along with the question
answers.append(
{
"question": query_text,
Expand Down
8 changes: 2 additions & 6 deletions evals/eval_framework/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def generate_metrics_dashboard(json_data, output_file="dashboard.html", benchmar
metrics_data = defaultdict(list)
metric_details = defaultdict(list)

# Include the score in the details if a reason is provided.
for entry in data:
for metric, values in entry["metrics"].items():
score = values["score"]
Expand All @@ -27,13 +26,12 @@ def generate_metrics_dashboard(json_data, output_file="dashboard.html", benchmar
"answer": entry["answer"],
"golden_answer": entry["golden_answer"],
"reason": values["reason"],
"score": score, # Added metric score here
"score": score,
}
)

figures = []

# Create histogram figures for each metric
for metric, scores in metrics_data.items():
fig = go.Figure()
fig.add_trace(go.Histogram(x=scores, name=metric, nbinsx=10, marker_color="#1f77b4"))
Expand All @@ -47,7 +45,6 @@ def generate_metrics_dashboard(json_data, output_file="dashboard.html", benchmar
)
figures.append(fig.to_html(full_html=False))

# Create a bar chart for average scores by metric
avg_scores = {metric: sum(scores) / len(scores) for metric, scores in metrics_data.items()}
fig = go.Figure()
fig.add_trace(
Expand All @@ -61,7 +58,6 @@ def generate_metrics_dashboard(json_data, output_file="dashboard.html", benchmar
)
figures.append(fig.to_html(full_html=False))

# Generate detailed explanations including metric score
details_html = []
for metric, details in metric_details.items():
details_html.append(f"<h3>{metric} Details</h3>")
Expand All @@ -82,7 +78,7 @@ def generate_metrics_dashboard(json_data, output_file="dashboard.html", benchmar
f"<td>{item['answer']}</td>"
f"<td>{item['golden_answer']}</td>"
f"<td>{item['reason']}</td>"
f"<td>{item['score']}</td>" # Add score column value here
f"<td>{item['score']}</td>"
f"</tr>"
)
details_html.append("</table>")
Expand Down

0 comments on commit 8f134f2

Please sign in to comment.