Update app.py
Browse files
app.py
CHANGED
@@ -608,13 +608,10 @@ def find_closest_lines(query, doc_texts, stop_words, top_n=15):
|
|
608 |
|
609 |
return closest_lines
|
610 |
|
611 |
-
def
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
cleaned_words = [word for word in words if word not in stop_words]
|
616 |
-
cleaned_lines.append(" ".join(cleaned_words))
|
617 |
-
return cleaned_lines
|
618 |
|
619 |
if query:
|
620 |
closest_lines = find_closest_lines(query, doc_texts, stop_words, top_n=15)
|
|
|
608 |
|
609 |
return closest_lines
|
610 |
|
611 |
+
def remove_stop_phrases(text, stop_words):
|
612 |
+
for phrase in stop_words:
|
613 |
+
text = text.replace(phrase, "")
|
614 |
+
return text
|
|
|
|
|
|
|
615 |
|
616 |
if query:
|
617 |
closest_lines = find_closest_lines(query, doc_texts, stop_words, top_n=15)
|