mp-02 commited on
Commit
a369b59
1 Parent(s): d68e9cd

Update sroie_inference.py

Browse files
Files changed (1) hide show
  1. sroie_inference.py +2 -2
sroie_inference.py CHANGED
@@ -5,8 +5,8 @@ from PIL import Image, ImageDraw, ImageFont
5
  from transformers import LayoutLMv3TokenizerFast, LayoutLMv3Processor, LayoutLMv3ForTokenClassification
6
  from utils import OCR, unnormalize_box
7
 
8
- # ["O", "B-COMPANY", "I-COMPANY", "B-DATE", "I-DATE", "B-ADDRESS", "I-ADDRESS", "B-TOTAL", "I-TOTAL"]
9
- labels = ["O", "COMPANY", "COMPANY", "DATE", "DATE", "ADDRESS", "ADDRESS", "TOTAL", "TOTAL"]
10
  id2label = {v: k for v, k in enumerate(labels)}
11
  label2id = {k: v for v, k in enumerate(labels)}
12
 
 
5
  from transformers import LayoutLMv3TokenizerFast, LayoutLMv3Processor, LayoutLMv3ForTokenClassification
6
  from utils import OCR, unnormalize_box
7
 
8
+ # [B-COMPANY", "I-COMPANY", "B-DATE", "I-DATE", "B-ADDRESS", "I-ADDRESS", "B-TOTAL", "I-TOTAL", "O"]
9
+ labels = ["COMPANY", "COMPANY", "DATE", "DATE", "ADDRESS", "ADDRESS", "TOTAL", "TOTAL", "O"]
10
  id2label = {v: k for v, k in enumerate(labels)}
11
  label2id = {k: v for v, k in enumerate(labels)}
12