Update app.py
Browse files
app.py
CHANGED
@@ -143,7 +143,9 @@ class FastDatasetSearcher:
|
|
143 |
|
144 |
def render_result(result):
|
145 |
"""Render a single search result"""
|
146 |
-
|
|
|
|
|
147 |
|
148 |
# Display video if available
|
149 |
if 'youtube_id' in result:
|
@@ -154,7 +156,7 @@ def render_result(result):
|
|
154 |
# Display other fields
|
155 |
cols = st.columns([2, 1])
|
156 |
with cols[0]:
|
157 |
-
for key, value in
|
158 |
if isinstance(value, (str, int, float)):
|
159 |
st.write(f"**{key}:** {value}")
|
160 |
|
|
|
143 |
|
144 |
def render_result(result):
|
145 |
"""Render a single search result"""
|
146 |
+
# Get score from the Series
|
147 |
+
score = result.get('score', 0) if 'score' in result else 0
|
148 |
+
result_filtered = result.drop('score') if 'score' in result else result
|
149 |
|
150 |
# Display video if available
|
151 |
if 'youtube_id' in result:
|
|
|
156 |
# Display other fields
|
157 |
cols = st.columns([2, 1])
|
158 |
with cols[0]:
|
159 |
+
for key, value in result_filtered.items():
|
160 |
if isinstance(value, (str, int, float)):
|
161 |
st.write(f"**{key}:** {value}")
|
162 |
|