Prasada commited on
Commit
e3ae3eb
1 Parent(s): 5e4f057

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -114,14 +114,14 @@ def process_image(image):
114
 
115
  # Convert OCR results to JSON
116
  json_results = convert_to_json(ocr_results[0])
117
- json_results_path = os.path.join("/app", 'ocr_results.json')
118
  with open(json_results_path, "w") as f:
119
  json.dump(json_results, f, indent=4)
120
 
121
  # Extract field-value pairs from the text
122
  text = " ".join([result[1][0] for result in ocr_results[0]])
123
  field_value_pairs = extract_field_value_pairs(text)
124
- field_value_pairs_path = os.path.join("/app", 'extracted_fields.json')
125
  with open(field_value_pairs_path, "w") as f:
126
  json.dump(field_value_pairs, f, indent=4)
127
 
 
114
 
115
  # Convert OCR results to JSON
116
  json_results = convert_to_json(ocr_results[0])
117
+ json_results_path = 'ocr_results.json' # Save in the root directory
118
  with open(json_results_path, "w") as f:
119
  json.dump(json_results, f, indent=4)
120
 
121
  # Extract field-value pairs from the text
122
  text = " ".join([result[1][0] for result in ocr_results[0]])
123
  field_value_pairs = extract_field_value_pairs(text)
124
+ field_value_pairs_path = 'extracted_fields.json' # Save in the root directory
125
  with open(field_value_pairs_path, "w") as f:
126
  json.dump(field_value_pairs, f, indent=4)
127