dmibor commited on
Commit
ec2e4f6
·
1 Parent(s): 216e1e1
__pycache__/search_core.cpython-312.pyc CHANGED
Binary files a/__pycache__/search_core.cpython-312.pyc and b/__pycache__/search_core.cpython-312.pyc differ
 
search_core.py CHANGED
@@ -593,9 +593,10 @@ def find_answer(question, context, threshold, max_answer_len=1000, top_k=20, ver
593
  #print('longest_result', longest_result)
594
  if best_result['score']>=threshold:
595
  longest_answer= longest_result['answer']
596
- answer_cleaned= re.sub(r"[\W\d_]+$", "", longest_answer).strip()
597
  if verbose==True:
598
- print(f'Ответ (уверенность= {round(model_result['score'], 2)}): {answer_cleaned}')
 
599
  longest_result['answer']= answer_cleaned
600
  found_answer=True
601
  if found_answer==False and verbose==True:
 
593
  #print('longest_result', longest_result)
594
  if best_result['score']>=threshold:
595
  longest_answer= longest_result['answer']
596
+ answer_cleaned= re.sub(r"[\W\d_]+$", '', longest_answer).strip()
597
  if verbose==True:
598
+ prob_value= round(model_result['score'], 2)
599
+ print(f'Ответ (уверенность= {prob_value}): {answer_cleaned}')
600
  longest_result['answer']= answer_cleaned
601
  found_answer=True
602
  if found_answer==False and verbose==True: