Update app.py
Browse files
app.py
CHANGED
@@ -516,7 +516,7 @@ def extract_keywords_from_text(text, query_words):
|
|
516 |
def clean_text(text):
|
517 |
return re.sub(r'[^آ-ی۰-۹0-9،.؟!؛+\-* ]+', '', text)
|
518 |
|
519 |
-
def find_closest_lines(query, doc_texts, stop_words, top_n=
|
520 |
cleaned_query = remove_stop_words(query, stop_words)
|
521 |
query_words = cleaned_query.split()
|
522 |
all_matched_lines = []
|
@@ -549,7 +549,7 @@ if query:
|
|
549 |
</div>
|
550 |
""", unsafe_allow_html=True)
|
551 |
|
552 |
-
closest_lines = find_closest_lines(query, doc_texts, stop_words, top_n=
|
553 |
cleaned_closest_lines = remove_stop_words_from_lines(closest_lines, stop_words)
|
554 |
|
555 |
if cleaned_closest_lines:
|
|
|
516 |
def clean_text(text):
|
517 |
return re.sub(r'[^آ-ی۰-۹0-9،.؟!؛+\-* ]+', '', text)
|
518 |
|
519 |
+
def find_closest_lines(query, doc_texts, stop_words, top_n=10):
|
520 |
cleaned_query = remove_stop_words(query, stop_words)
|
521 |
query_words = cleaned_query.split()
|
522 |
all_matched_lines = []
|
|
|
549 |
</div>
|
550 |
""", unsafe_allow_html=True)
|
551 |
|
552 |
+
closest_lines = find_closest_lines(query, doc_texts, stop_words, top_n=2)
|
553 |
cleaned_closest_lines = remove_stop_words_from_lines(closest_lines, stop_words)
|
554 |
|
555 |
if cleaned_closest_lines:
|