CCockrum commited on
Commit
fdea5e7
·
verified ·
1 Parent(s): 909496d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -211,9 +211,9 @@ if fetch_data:
211
 
212
  st.subheader("Suggested Metadata Enhancements")
213
  incomplete_with_desc = incomplete_records[incomplete_records['description'].notnull()]
214
- reference_df = metadata_df[metadata_df['subject'].notnull() & metadata_df['description'].notnull()]
215
- tfidf_matrix = tfidf.fit_transform(reference_df['description'])
216
- if len(filled_descriptions) > 1:
217
  try:
218
  tfidf = TfidfVectorizer(stop_words='english')
219
  tfidf_matrix = tfidf.fit_transform(filled_descriptions)
 
211
 
212
  st.subheader("Suggested Metadata Enhancements")
213
  incomplete_with_desc = incomplete_records[incomplete_records['description'].notnull()]
214
+ reference_df = metadata_df[metadata_df['subject'].notnull() & metadata_df['description'].notnull()]
215
+ tfidf_matrix = tfidf.fit_transform(reference_df['description'])
216
+ if len(incomplete_with_desc) > 1 and len(reference_df) > 1:
217
  try:
218
  tfidf = TfidfVectorizer(stop_words='english')
219
  tfidf_matrix = tfidf.fit_transform(filled_descriptions)