Spaces:
Runtime error
Runtime error
putting the noise back in
Browse files
app.py
CHANGED
|
@@ -46,9 +46,10 @@ def parse_ticket_image(image):
|
|
| 46 |
|
| 47 |
for idx, pred in enumerate(predictions):
|
| 48 |
label = model.config.id2label[pred]
|
|
|
|
| 49 |
# apparently stands for non-entity tokens
|
| 50 |
-
if label != 'LABEL_0' and '<' not in words[idx]:
|
| 51 |
-
|
| 52 |
|
| 53 |
if len(extracted_fields) == 0:
|
| 54 |
print(f"Warning - no fields were extracted!")
|
|
|
|
| 46 |
|
| 47 |
for idx, pred in enumerate(predictions):
|
| 48 |
label = model.config.id2label[pred]
|
| 49 |
+
extracted_fields.append((label, words[idx]))
|
| 50 |
# apparently stands for non-entity tokens
|
| 51 |
+
#if label != 'LABEL_0' and '<' not in words[idx]:
|
| 52 |
+
# extracted_fields.append((label, words[idx]))
|
| 53 |
|
| 54 |
if len(extracted_fields) == 0:
|
| 55 |
print(f"Warning - no fields were extracted!")
|