shivanis14 commited on
Commit
e577340
1 Parent(s): fd29cb3

Update data_extractor.py

Browse files
Files changed (1) hide show
  1. data_extractor.py +4 -3
data_extractor.py CHANGED
@@ -136,12 +136,13 @@ def extract_data(image_links):
136
  # Call the extraction function
137
  extracted_data = extract_information(image_links)
138
  print(f"extracted data : {extracted_data} ")
 
139
 
140
  if extracted_data:
141
- ans = json.loads(extracted_data)
142
  # Store in MongoDB
143
- collection.insert_one(ans)
144
- return ans
145
  else:
146
  return {"error": "Failed to extract information"}
147
 
 
136
  # Call the extraction function
137
  extracted_data = extract_information(image_links)
138
  print(f"extracted data : {extracted_data} ")
139
+ print(f"extracted data : {type(extracted_data)} ")
140
 
141
  if extracted_data:
142
+ #ans = json.loads(extracted_data)
143
  # Store in MongoDB
144
+ collection.insert_one(extracted_data)
145
+ return extracted_data
146
  else:
147
  return {"error": "Failed to extract information"}
148