Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -609,18 +609,25 @@ def run_detailed_comparison():
|
|
609 |
"Ontology-Enhanced RAG": list(enhanced_metrics.values())
|
610 |
})
|
611 |
|
612 |
-
#
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
)
|
621 |
-
|
|
|
622 |
st.plotly_chart(fig, use_container_width=True)
|
623 |
-
|
624 |
st.markdown("""
|
625 |
The figure above shows a comparison of the two RAG methods in terms of context quality. Ontology-enhanced RAG performs better in multiple dimensions:
|
626 |
|
|
|
609 |
"Ontology-Enhanced RAG": list(enhanced_metrics.values())
|
610 |
})
|
611 |
|
612 |
+
# Filter out columns with incomplete data to avoid inconsistencies between theta and r
|
613 |
+
plot_df = df.dropna(subset=["Metric", "Value", "Method"])
|
614 |
+
|
615 |
+
# Ensure the transformation is correct
|
616 |
+
plot_df = plot_df.astype({"Metric": str, "Value": float, "Method": str})
|
617 |
+
|
618 |
+
# Use bar_polar to avoid wiring errors
|
619 |
+
fig = px.bar_polar(
|
620 |
+
plot_df,
|
621 |
+
r="Value",
|
622 |
+
theta="Metric",
|
623 |
+
color="Method",
|
624 |
+
title="Context Quality Assessment (Polar View)",
|
625 |
+
color_discrete_sequence=px.colors.qualitative.Set2
|
626 |
)
|
627 |
+
|
628 |
+
fig.update_layout(polar=dict(radialaxis=dict(visible=True)), showlegend=True)
|
629 |
st.plotly_chart(fig, use_container_width=True)
|
630 |
+
|
631 |
st.markdown("""
|
632 |
The figure above shows a comparison of the two RAG methods in terms of context quality. Ontology-enhanced RAG performs better in multiple dimensions:
|
633 |
|