Update SLR.py
Browse files
SLR.py
CHANGED
|
@@ -72,7 +72,7 @@ class SLR(datasets.GeneratorBasedBuilder):
|
|
| 72 |
"bboxes": datasets.Sequence(datasets.Sequence(datasets.Value("int64"))),
|
| 73 |
"ner_tags": datasets.Sequence(
|
| 74 |
datasets.features.ClassLabel(
|
| 75 |
-
names=["Borrower", "BorrowerValue", "City", "CityValue", "PUD","PerMonth","PerYear","State","StateValue","Table"]
|
| 76 |
)
|
| 77 |
),
|
| 78 |
"image": datasets.Array3D(shape=(3, 224, 224), dtype="uint8"),
|
|
@@ -101,7 +101,7 @@ class SLR(datasets.GeneratorBasedBuilder):
|
|
| 101 |
ann_dir = os.path.join(filepath, "annotations")
|
| 102 |
img_dir = os.path.join(filepath, "images")
|
| 103 |
for guid, file in enumerate(sorted(os.listdir(ann_dir))):
|
| 104 |
-
words=[
|
| 105 |
tokens = []
|
| 106 |
bboxes = []
|
| 107 |
ner_tags = []
|
|
@@ -115,7 +115,7 @@ class SLR(datasets.GeneratorBasedBuilder):
|
|
| 115 |
for item in data['categories']:
|
| 116 |
|
| 117 |
labels=item['name']
|
| 118 |
-
|
| 119 |
ner_tags.append(labels)
|
| 120 |
for item in data['annotations']:
|
| 121 |
bbox=item['bbox']
|
|
|
|
| 72 |
"bboxes": datasets.Sequence(datasets.Sequence(datasets.Value("int64"))),
|
| 73 |
"ner_tags": datasets.Sequence(
|
| 74 |
datasets.features.ClassLabel(
|
| 75 |
+
names=["Borrower", "BorrowerValue", "City", "CityValue", "PUD","PerMonth","PerYear","State","StateValue","Table","TableValue"]
|
| 76 |
)
|
| 77 |
),
|
| 78 |
"image": datasets.Array3D(shape=(3, 224, 224), dtype="uint8"),
|
|
|
|
| 101 |
ann_dir = os.path.join(filepath, "annotations")
|
| 102 |
img_dir = os.path.join(filepath, "images")
|
| 103 |
for guid, file in enumerate(sorted(os.listdir(ann_dir))):
|
| 104 |
+
words=[]
|
| 105 |
tokens = []
|
| 106 |
bboxes = []
|
| 107 |
ner_tags = []
|
|
|
|
| 115 |
for item in data['categories']:
|
| 116 |
|
| 117 |
labels=item['name']
|
| 118 |
+
words.append(labels)
|
| 119 |
ner_tags.append(labels)
|
| 120 |
for item in data['annotations']:
|
| 121 |
bbox=item['bbox']
|