klue/klue
Viewer • Updated • 206k • 7.26k • 92
How to use deliciouscat/kf-deberta-base-cross-nli with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("zero-shot-classification", model="deliciouscat/kf-deberta-base-cross-nli") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("deliciouscat/kf-deberta-base-cross-nli")
model = AutoModelForSequenceClassification.from_pretrained("deliciouscat/kf-deberta-base-cross-nli")kor-nli 및 klue-nli로 학습하였습니다.
test accuracy(KLUE-NLI): 0.889667
model_name = 'deliciouscat/kf-deberta-base-cross-nli'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=3).to(device)
def encode(examples):
return tokenizer(examples['premise'], examples['hypothesis'], truncation=True, padding='max_length', max_length=128)