Instead of AutoModel you’ll probably just need AutoModelForTokenClassification. You can also have a look at the existing examples with NER: transformers/examples/pytorch/token-classification at master · huggingface/transformers · GitHub 2