YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Load model

from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("heegyu/esconv-xlm-roberta-base")
model = AutoModelForSequenceClassification.from_pretrained("heegyu/esconv-xlm-roberta-base")

Next strategy prediction

example = """usr: Hi
sys[Question]: Hello, how are you today?
usr: I was scolded by my parents yesterday"""

inputs = tokenizer(example, return_tensors="pt")
logits = model(**inputs).logits.softmax(-1)
print(logits)

label = logits.argmax(-1).item()


ESCONV_STRATEGY = [
    "Question",
    "Restatement or Paraphrasing",
    "Reflection of feelings",
    "Self-disclosure",
    "Affirmation and Reassurance",
    "Providing Suggestions",
    "Information",
    "Others"
]
id2label = {i:k for i, k in enumerate(ESCONV_STRATEGY)}

print(id2label[label])

Next strategy prediction (top 3)

example = """usr: Hi
sys[Question]: Hello, how are you today?
usr: I was scolded by my parents yesterday"""

inputs = tokenizer(example, return_tensors="pt")
logits = model(**inputs).logits.softmax(-1)
print(logits)

labels = logits.topk(3)[1][0].tolist()


ESCONV_STRATEGY = [
    "Question",
    "Restatement or Paraphrasing",
    "Reflection of feelings",
    "Self-disclosure",
    "Affirmation and Reassurance",
    "Providing Suggestions",
    "Information",
    "Others"
]
id2label = {i:k for i, k in enumerate(ESCONV_STRATEGY)}

for id in labels:
  print(id2label[id])
Downloads last month
3
Safetensors
Model size
278M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support