Spaces:
Paused
Paused
normalize steel
Browse files194 unmodified lines195196197198199200201202203204205206207208209210211212213194 unmodified linesreturn matchingfrom documents_prep import normalize_textdef answer_question(question, query_engine, reranker, current_model, chunks_df=None, rerank_top_k=20):normalized_question = normalize_text(question)if query_engine is None:return "<div style='background-color: #e53e3e; color: white; padding: 20px; border-radius: 10px;'>Система не инициализирована</div>", "", ""try:start_time = time.time()retrieved_nodes = query_engine.retriever.retrieve(normalized_question)log_message(f"user query: {question}")log_message(f"normalized query: {normalized_question}")log_message(f"RETRIEVED: {len(retrieved_nodes)} nodes")194 unmodified lines195196197198199200201202203204205206207208209210211212213214215216217218194 unmodified linesreturn matchingfrom documents_prep import normalize_text, normalize_steel_designationsdef answer_question(question, query_engine, reranker, current_model, chunks_df=None, rerank_top_k=20):normalized_question = normalize_text(question)log_message(f"Normalized question: {normalized_question}")normalized_question_2 = normalize_steel_designations(normalized_question)log_message(f"After steel normalization: {normalized_question_2}")if query_engine is None:return "<div style='background-color: #e53e3e; color: white; padding: 20px; border-radius: 10px;'>Система не инициализирована</div>", "", ""try:start_time = time.time()retrieved_nodes = query_engine.retriever.retrieve(normalized_question_2)log_message(f"user query: {question}")log_message(f"normalized query: {normalized_question}")log_message(f"after steel normalization: {normalized_question_2}")log_message(f"RETRIEVED: {len(retrieved_nodes)} nodes")
utils.py+7-2