Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -216,7 +216,7 @@ if fetch_data:
|
|
216 |
tfidf_matrix = tfidf.fit_transform(filled_descriptions)
|
217 |
suggestions = []
|
218 |
for idx, row in incomplete_records.iterrows():
|
219 |
-
if pd.
|
220 |
desc_vec = tfidf.transform([str(row['description'])])
|
221 |
sims = cosine_similarity(desc_vec, tfidf_matrix).flatten()
|
222 |
top_idx = sims.argmax()
|
@@ -228,7 +228,12 @@ if fetch_data:
|
|
228 |
st.markdown("<div class='custom-table'>" + suggestions_df.to_markdown(index=True) + "</div>", unsafe_allow_html=True)
|
229 |
|
230 |
else:
|
231 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
232 |
except Exception as e:
|
233 |
st.error(f"Error generating metadata suggestions: {e}")
|
234 |
else:
|
|
|
216 |
tfidf_matrix = tfidf.fit_transform(filled_descriptions)
|
217 |
suggestions = []
|
218 |
for idx, row in incomplete_records.iterrows():
|
219 |
+
if pd.notna(row['description']):
|
220 |
desc_vec = tfidf.transform([str(row['description'])])
|
221 |
sims = cosine_similarity(desc_vec, tfidf_matrix).flatten()
|
222 |
top_idx = sims.argmax()
|
|
|
228 |
st.markdown("<div class='custom-table'>" + suggestions_df.to_markdown(index=True) + "</div>", unsafe_allow_html=True)
|
229 |
|
230 |
else:
|
231 |
+
st.markdown("""
|
232 |
+
<div class='custom-table'>
|
233 |
+
<b>ℹ️ No metadata enhancement suggestions available.</b>
|
234 |
+
</div>
|
235 |
+
""", unsafe_allow_html=True)
|
236 |
+
|
237 |
except Exception as e:
|
238 |
st.error(f"Error generating metadata suggestions: {e}")
|
239 |
else:
|