Spaces:
Sleeping
Sleeping
Update extract_and_store_supabase.py
Browse files
extract_and_store_supabase.py
CHANGED
@@ -116,14 +116,21 @@ def extract_structure_store_message(user_id:str,message_id:str , attachment_id:s
|
|
116 |
"mention_text": mention_text,
|
117 |
"normalizedValue": normalized_values
|
118 |
})
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
document_entities['email'] = email
|
128 |
document_entities['message_id'] = message_id
|
129 |
print(document_entities)
|
|
|
116 |
"mention_text": mention_text,
|
117 |
"normalizedValue": normalized_values
|
118 |
})
|
119 |
+
if 'line_item/description' in document_entities:
|
120 |
+
document_entities['line_item_description'] = document_entities['line_item/description']
|
121 |
+
document_entities.pop('line_item/description', None)
|
122 |
+
|
123 |
+
if 'line_item/quantity' in document_entities:
|
124 |
+
document_entities['line_item_quantity'] = document_entities['line_item/quantity']
|
125 |
+
document_entities.pop('line_item/quantity', None)
|
126 |
+
|
127 |
+
if 'line_item/amount' in document_entities:
|
128 |
+
document_entities['line_item_amount'] = document_entities['line_item/amount']
|
129 |
+
document_entities.pop('line_item/amount', None)
|
130 |
+
|
131 |
+
if 'line_item/unit_price' in document_entities:
|
132 |
+
document_entities['line_item_unit_price'] = document_entities['line_item/unit_price']
|
133 |
+
document_entities.pop('line_item/unit_price', None)
|
134 |
document_entities['email'] = email
|
135 |
document_entities['message_id'] = message_id
|
136 |
print(document_entities)
|