Commit
·
ee9ab1e
1
Parent(s):
7b8025e
Update EZPass-Dataset.py
Browse files- EZPass-Dataset.py +4 -5
EZPass-Dataset.py
CHANGED
@@ -20,8 +20,6 @@
|
|
20 |
import json
|
21 |
|
22 |
import datasets
|
23 |
-
from datasets.tasks import QuestionAnsweringExtractive
|
24 |
-
|
25 |
|
26 |
logger = datasets.logging.get_logger(__name__)
|
27 |
|
@@ -53,8 +51,7 @@ descriptions = [
|
|
53 |
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"mailing_number\": \"B1531128696669\", \"mailing_date\": \"06/29/2023\",\"NOTD_amount_due\": \"$6.00\",\"by\": \"07/31/2023\", \"toll_amount_due\": \"$6.00\", \"video_toll_transaction_number\": \"B1531128696669-00001\", \"state/license_plate\": \"PA/LSY0217\", \"location_toll\": \"Baltimore City I-95 Fort McHenry Tunnel\", \"exit_date_and_time_of_toll\": \"10/11/2022 05:40:51 PM\"}}',
|
54 |
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"mailing_number\": \"B1531123158574\", \"mailing_date\": \"09/21/2022\",\"NOTD_amount_due\": \"$6.00\",\"by\": \"08/31/2022\", \"toll_amount_due\": \"$6.00\", \"video_toll_transaction_number\": \"B1531123158574-00001\", \"state/license_plate\": \"PA/LDJ1110\", \"location_toll\": \"Baltimore City I-95 Fort McHenry Tunnel\", \"exit_date_and_time_of_toll\": \"02/09/2021 09:55:37 AM\"}}',
|
55 |
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"invoice_number\": \"120691145-1\", \"account_number\": \"1214734\", \"invoice_date\": \"09/23/2022\", \"license_plate\": \"PA-LDJ1110\", \"payment_due\": \"$8.70\", \"payment_due_date\": \"10/13/2022\", \"amount_due\": \"$8.70\"}}',
|
56 |
-
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"invoice_number\": \"112580557-1\", \"account_number\": \"1214734\", \"license_plate\": \"PA-LSY0217\", \"invoice_date\": \"09/23/21\",\"toll_charges\": \"$0.00\", \"payments\": \"$0.00\",\"adjustments\": \"$0.00\",\"fees\": \"$0.00\",\"payment_due\": \"$6.00\", \"payment_due_date\": \"10/13/2021\", \"amount_due\": \"$6.00\"}}'
|
57 |
-
]
|
58 |
|
59 |
"""
|
60 |
descriptions = ['Test1',
|
@@ -96,10 +93,12 @@ class EZPassTargz(datasets.GeneratorBasedBuilder):
|
|
96 |
]
|
97 |
|
98 |
def _generate_examples(self, images):
|
|
|
99 |
idx = 0
|
100 |
for filepath, image in images:
|
101 |
yield idx,{
|
|
|
102 |
"image":{"path": filepath,"bytes":image.read()},
|
103 |
-
|
104 |
}
|
105 |
idx += 1
|
|
|
20 |
import json
|
21 |
|
22 |
import datasets
|
|
|
|
|
23 |
|
24 |
logger = datasets.logging.get_logger(__name__)
|
25 |
|
|
|
51 |
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"mailing_number\": \"B1531128696669\", \"mailing_date\": \"06/29/2023\",\"NOTD_amount_due\": \"$6.00\",\"by\": \"07/31/2023\", \"toll_amount_due\": \"$6.00\", \"video_toll_transaction_number\": \"B1531128696669-00001\", \"state/license_plate\": \"PA/LSY0217\", \"location_toll\": \"Baltimore City I-95 Fort McHenry Tunnel\", \"exit_date_and_time_of_toll\": \"10/11/2022 05:40:51 PM\"}}',
|
52 |
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"mailing_number\": \"B1531123158574\", \"mailing_date\": \"09/21/2022\",\"NOTD_amount_due\": \"$6.00\",\"by\": \"08/31/2022\", \"toll_amount_due\": \"$6.00\", \"video_toll_transaction_number\": \"B1531123158574-00001\", \"state/license_plate\": \"PA/LDJ1110\", \"location_toll\": \"Baltimore City I-95 Fort McHenry Tunnel\", \"exit_date_and_time_of_toll\": \"02/09/2021 09:55:37 AM\"}}',
|
53 |
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"invoice_number\": \"120691145-1\", \"account_number\": \"1214734\", \"invoice_date\": \"09/23/2022\", \"license_plate\": \"PA-LDJ1110\", \"payment_due\": \"$8.70\", \"payment_due_date\": \"10/13/2022\", \"amount_due\": \"$8.70\"}}',
|
54 |
+
'{\"header\": {\"to\": \"FEITH SYSTEMS AND SOFTWARE\",\"billing_address\": \"425 MARYLAND DR FT WASHINGTON PA 19034-2501\",\"invoice_number\": \"112580557-1\", \"account_number\": \"1214734\", \"license_plate\": \"PA-LSY0217\", \"invoice_date\": \"09/23/21\",\"toll_charges\": \"$0.00\", \"payments\": \"$0.00\",\"adjustments\": \"$0.00\",\"fees\": \"$0.00\",\"payment_due\": \"$6.00\", \"payment_due_date\": \"10/13/2021\", \"amount_due\": \"$6.00\"}}']
|
|
|
55 |
|
56 |
"""
|
57 |
descriptions = ['Test1',
|
|
|
93 |
]
|
94 |
|
95 |
def _generate_examples(self, images):
|
96 |
+
"""This function returns the examples in the raw (text) form."""
|
97 |
idx = 0
|
98 |
for filepath, image in images:
|
99 |
yield idx,{
|
100 |
+
"text": descriptions[idx],
|
101 |
"image":{"path": filepath,"bytes":image.read()},
|
102 |
+
|
103 |
}
|
104 |
idx += 1
|