Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -66,6 +66,7 @@ def plot_radar_chart(ragas_results):
|
|
66 |
ax.set_xticklabels(labels)
|
67 |
|
68 |
ax.set_title('RAGAS Metrics Radar Chart', size=14, y=1.05)
|
|
|
69 |
|
70 |
chart_path = "radar_chart.png"
|
71 |
fig.savefig(chart_path)
|
@@ -79,11 +80,11 @@ def generate_word_report(science_goal, ragas_results, radar_chart_path):
|
|
79 |
doc.add_heading("Science Goal", level=1)
|
80 |
doc.add_paragraph(science_goal)
|
81 |
|
82 |
-
doc.add_heading("RAGAS Evaluation Scores", level=1)
|
83 |
for metric, score in ragas_results.scores[0].items():
|
84 |
doc.add_paragraph(f"{metric}: {score*100:.2f}%")
|
85 |
|
86 |
-
doc.add_heading("
|
87 |
doc.add_picture(radar_chart_path, width=Inches(5))
|
88 |
|
89 |
output_path = "SCDD_Evaluation_Report.docx"
|
@@ -145,7 +146,7 @@ interface = gr.Interface(
|
|
145 |
],
|
146 |
outputs=[
|
147 |
gr.JSON(label="RAGAS Scores"),
|
148 |
-
gr.Image(label="Radar Chart"),
|
149 |
gr.File(label="Download Word Report")
|
150 |
],
|
151 |
title="RAGAS Evaluation: AI vs Human SCDD",
|
|
|
66 |
ax.set_xticklabels(labels)
|
67 |
|
68 |
ax.set_title('RAGAS Metrics Radar Chart', size=14, y=1.05)
|
69 |
+
plt.tight_layout()
|
70 |
|
71 |
chart_path = "radar_chart.png"
|
72 |
fig.savefig(chart_path)
|
|
|
80 |
doc.add_heading("Science Goal", level=1)
|
81 |
doc.add_paragraph(science_goal)
|
82 |
|
83 |
+
doc.add_heading("RAGAS SCDD Evaluation Scores", level=1)
|
84 |
for metric, score in ragas_results.scores[0].items():
|
85 |
doc.add_paragraph(f"{metric}: {score*100:.2f}%")
|
86 |
|
87 |
+
doc.add_heading("RAGAS Metrics Chart", level=1)
|
88 |
doc.add_picture(radar_chart_path, width=Inches(5))
|
89 |
|
90 |
output_path = "SCDD_Evaluation_Report.docx"
|
|
|
146 |
],
|
147 |
outputs=[
|
148 |
gr.JSON(label="RAGAS Scores"),
|
149 |
+
gr.Image(label="RAGAS Metrics Radar Chart"),
|
150 |
gr.File(label="Download Word Report")
|
151 |
],
|
152 |
title="RAGAS Evaluation: AI vs Human SCDD",
|