MANIKANDAN A commited on
Commit
d50f4f4
1 Parent(s): 67b4e82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -351,7 +351,7 @@ def extract_important_term(caption):
351
  stop_words = set(stopwords.words('english'))
352
  words = caption.lower().split()
353
  filtered_words = [word for word in words if word not in stop_words]
354
-
355
  # Find the longest word
356
  important_term = filtered_words
357
 
 
351
  stop_words = set(stopwords.words('english'))
352
  words = caption.lower().split()
353
  filtered_words = [word for word in words if word not in stop_words]
354
+ filtered_words = [word for word in filtered_words if re.match(r'^[a-zA-Z]+$', word)]
355
  # Find the longest word
356
  important_term = filtered_words
357