shivanis14
commited on
Commit
•
e577340
1
Parent(s):
fd29cb3
Update data_extractor.py
Browse files- 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(
|
144 |
-
return
|
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 |
|