gopichandra commited on
Commit
ab7dcd2
·
verified ·
1 Parent(s): 3dde1a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -102,8 +102,10 @@ def match_product_name(extracted_text, threshold=70):
102
  best_match = None
103
  best_score = 0
104
 
 
105
  for line in extracted_text.split("\n"):
106
  match, score = process.extractOne(line, PRODUCT_NAMES)
 
107
  if score > best_score:
108
  best_match = match
109
  best_score = score
@@ -326,7 +328,7 @@ def app():
326
  message = export_to_salesforce(mode, entry_type, quantity, attributes)
327
  return message
328
 
329
- export_button.click(export_attributes, inputs=[mode_input, entry_type_input, quantity_input, attributes_output], outputs=result_output)
330
 
331
  with gr.Tab("📊 Salesforce Data Export"):
332
  selected_object_input = gr.Dropdown(label="Select Salesforce Object", choices=["Inventory_Management__c", "Un_Billable__c"], value="Inventory_Management__c")
 
102
  best_match = None
103
  best_score = 0
104
 
105
+ print("Matching Process:") # Debugging: Print matching process
106
  for line in extracted_text.split("\n"):
107
  match, score = process.extractOne(line, PRODUCT_NAMES)
108
+ print(f"Line: {line}, Match: {match}, Score: {score}") # Debugging: Print each line and its match score
109
  if score > best_score:
110
  best_match = match
111
  best_score = score
 
328
  message = export_to_salesforce(mode, entry_type, quantity, attributes)
329
  return message
330
 
331
+ export_button.click(export_attributes, inputs=[mode_input, entry_type_input, quantity_input, attributes_output], outputs=[result_output])
332
 
333
  with gr.Tab("📊 Salesforce Data Export"):
334
  selected_object_input = gr.Dropdown(label="Select Salesforce Object", choices=["Inventory_Management__c", "Un_Billable__c"], value="Inventory_Management__c")