according to the answer given in this post, AutoModelForSequenceClassification has a classification head on the top of the model outputs which can be easily trained with the base model (I'm assuming the person talks about AutoModel). I want to use only AutoModel (model similar to AutoModel, as this is the model pretrained by me) for my NER task, but the ner task requires an AutoModelForTokenClassification instead as shown in the following pipeline :
from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer
model = AutoModelForTokenClassification.from_pretrained("skimai/spanberta-base-cased-ner-conll02")
tokenizer = AutoTokenizer.from_pretrained("skimai/spanberta-base-cased-ner-conll02")
ner_model = pipeline('ner', model=model, tokenizer=tokenizer)
The code is taken from this notebook.
Is it possible to use AutoModel (model similar to AutoModel) for NER task?