MrSimple07 commited on
Commit
0f89c6b
·
1 Parent(s): bd2b030

added a new loggers for normalizations

Browse files
Files changed (2) hide show
  1. documents_prep.py +1 -1
  2. utils.py +3 -2
documents_prep.py CHANGED
@@ -98,7 +98,7 @@ def chunk_text_documents(documents):
98
  for i, chunk in enumerate(chunks):
99
  # Normalize steel designations in the chunk text
100
  original_text = chunk.text
101
- chunk.text, changes = normalize_steel_designations(chunk.text)
102
 
103
  if changes > 0:
104
  chunks_with_changes += 1
 
98
  for i, chunk in enumerate(chunks):
99
  # Normalize steel designations in the chunk text
100
  original_text = chunk.text
101
+ chunk.text, changes, change_list = normalize_steel_designations(chunk.text) # FIX: 3 values
102
 
103
  if changes > 0:
104
  chunks_with_changes += 1
utils.py CHANGED
@@ -201,9 +201,10 @@ def answer_question(question, query_engine, reranker, current_model, chunks_df=N
201
 
202
  normalized_question = normalize_text(question)
203
  log_message(f"Normalized question: {normalized_question}")
204
- normalized_question_2, query_changes = normalize_steel_designations(question)
205
  log_message(f"After steel normalization: {normalized_question_2}")
206
-
 
207
  if query_engine is None:
208
  return "<div style='background-color: #e53e3e; color: white; padding: 20px; border-radius: 10px;'>Система не инициализирована</div>", "", ""
209
 
 
201
 
202
  normalized_question = normalize_text(question)
203
  log_message(f"Normalized question: {normalized_question}")
204
+ normalized_question_2, query_changes, change_list = normalize_steel_designations(question) # FIX: 3 values
205
  log_message(f"After steel normalization: {normalized_question_2}")
206
+ if change_list:
207
+ log_message(f"Query changes: {', '.join(change_list)}")
208
  if query_engine is None:
209
  return "<div style='background-color: #e53e3e; color: white; padding: 20px; border-radius: 10px;'>Система не инициализирована</div>", "", ""
210