Spaces:
Runtime error
Runtime error
filter out noise
Browse files
app.py
CHANGED
|
@@ -46,8 +46,8 @@ def parse_ticket_image(image):
|
|
| 46 |
|
| 47 |
for idx, pred in enumerate(predictions):
|
| 48 |
label = model.config.id2label[pred]
|
| 49 |
-
# apparently
|
| 50 |
-
if label != '
|
| 51 |
extracted_fields.append((label, words[idx]))
|
| 52 |
|
| 53 |
if len(extracted_fields) == 0:
|
|
|
|
| 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 |
extracted_fields.append((label, words[idx]))
|
| 52 |
|
| 53 |
if len(extracted_fields) == 0:
|