FiberGate / tools /show_extractor_labels.py
AzizMiladi's picture
Add v3 extractor, recommendation engine, CMS generator, Streamlit demo, and tests
33ddb61
Raw
History Blame
298 Bytes
from pathlib import Path
from transformers import LayoutLMv3ForTokenClassification
model_dir = Path('models/extractor_v3') / 'checkpoint-645'
print('Loading model from', model_dir)
model = LayoutLMv3ForTokenClassification.from_pretrained(model_dir)
print('id2label:')
print(model.config.id2label)