模型:
echarlaix/distilbert-base-uncased-finetuned-sst-2-english-openvino
模型描述:此模型是DistilBERT-base-uncased的微调检查点,通过对SST-2数据集进行微调而得到。该模型在开发集上达到了91.3的准确度。
您可以使用此模型与Transformers pipeline一起使用。
from transformers import AutoTokenizer, pipeline from optimum.intel.openvino import OVModelForSequenceClassification model_id = "echarlaix/distilbert-base-uncased-finetuned-sst-2-english-openvino" model = OVModelForSequenceClassification.from_pretrained(model_id) tokenizer = AutoTokenizer.from_pretrained(model_id) cls_pipe = pipeline("text-classification", model=model, tokenizer=tokenizer) text = "He's a dreadful magician." outputs = cls_pipe(text)