M17idd commited on
Commit
6a17713
·
verified ·
1 Parent(s): e6a1539

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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=20):
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=3)
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: