Spaces:
Running
Running
Update src/visualization.py
Browse files- src/visualization.py +12 -12
src/visualization.py
CHANGED
@@ -1,3 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def display_reasoning_trace(query: str, retrieved_docs: List[Dict], answer: str, ontology_manager):
|
2 |
"""Display an enhanced trace of how ontological reasoning was used to answer the query."""
|
3 |
st.subheader("🧠 Ontology-Enhanced Reasoning")
|
@@ -364,18 +376,6 @@ def explain_ontology_advantages(entity_mentions: List[Dict], relationship_mentio
|
|
364 |
|
365 |
return advantages# src/visualization.py
|
366 |
|
367 |
-
import streamlit as st
|
368 |
-
import json
|
369 |
-
import networkx as nx
|
370 |
-
import pandas as pd
|
371 |
-
from typing import Dict, List, Any, Optional, Set, Tuple
|
372 |
-
import plotly.graph_objects as go
|
373 |
-
import plotly.express as px
|
374 |
-
import matplotlib.pyplot as plt
|
375 |
-
import matplotlib.colors as mcolors
|
376 |
-
from collections import defaultdict
|
377 |
-
import math
|
378 |
-
|
379 |
def render_html_in_streamlit(html_content: str):
|
380 |
"""Display HTML content in Streamlit using components.html."""
|
381 |
import streamlit.components.v1 as components
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import json
|
3 |
+
import networkx as nx
|
4 |
+
import pandas as pd
|
5 |
+
from typing import Dict, List, Any, Optional, Set, Tuple
|
6 |
+
import plotly.graph_objects as go
|
7 |
+
import plotly.express as px
|
8 |
+
import matplotlib.pyplot as plt
|
9 |
+
import matplotlib.colors as mcolors
|
10 |
+
from collections import defaultdict
|
11 |
+
import math
|
12 |
+
|
13 |
def display_reasoning_trace(query: str, retrieved_docs: List[Dict], answer: str, ontology_manager):
|
14 |
"""Display an enhanced trace of how ontological reasoning was used to answer the query."""
|
15 |
st.subheader("🧠 Ontology-Enhanced Reasoning")
|
|
|
376 |
|
377 |
return advantages# src/visualization.py
|
378 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
def render_html_in_streamlit(html_content: str):
|
380 |
"""Display HTML content in Streamlit using components.html."""
|
381 |
import streamlit.components.v1 as components
|