rosemariafontana commited on
Commit
763a8d9
Β·
verified Β·
1 Parent(s): d239f9c

filter out noise

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 'O' stands for non-entity tokens
50
- if label != 'O':
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: