Blablablab / empathy-appraisal-span

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: May 06 2024

Introduction of empathy-appraisal-span

Model Details of empathy-appraisal-span

Model Description

The model classifies an appraisal given a sentence and is trained on ALOE dataset.

Input: a sentence

Labels: No Label, Pleasantness, Anticipated Effort, Certainty, Objective Experience, Self-Other Agency, Situational Control, Advice, Trope

Output: logits (in order of labels)

Model architecture : OpenPrompt_+RoBERTa

Developed by: Jiamin Yang

Model Performance
Overall performance
Macro-F1 Recall Precision
0.56 0.57 0.58
Per-label performance
Label Recall Precision
No Label 0.34 0.64
Pleasantness 0.69 0.54
Anticipated Effort 0.46 0.46
Certainty 0.58 0.47
Objective Experience 0.58 0.69
Self-Other Agency 0.62 0.55
Situational Control 0.31 0.55
Advice 0.72 0.66
Trope 0.80 0.67
Getting Started
import torch
from openprompt.plms import load_plm
from openprompt.prompts import ManualTemplate
from openprompt.prompts import ManualVerbalizer
from openprompt import PromptForClassification
from openprompt.data_utils import InputExample
from openprompt import PromptDataLoader

checkpoint_file = 'your_path_to/empathy-appraisal-span.pt'

plm, tokenizer, model_config, WrapperClass = load_plm('roberta', 'roberta-large')
template_text = 'The sentence {"placeholder":"text_a"} has the label {"mask"}.'
template = ManualTemplate(tokenizer=tokenizer, text=template_text)

num_classes = 9
label_words = [['No Label'], ['Pleasantness'], ['Anticipated Effort'], ['Certainty'], ['Objective Experience'], ['Self-Other Agency'], ['Situational Control'], ['Advice'], ['Trope']]
verbalizer = ManualVerbalizer(tokenizer, num_classes=num_classes, label_words=label_words)
prompt_model = PromptForClassification(plm=plm,template=template, verbalizer=verbalizer, freeze_plm=False).to('cuda')

checkpoint = torch.load(checkpoint_file)
state_dict = checkpoint['model_state_dict']

# depend on the version of torch
del state_dict['prompt_model.plm.roberta.embeddings.position_ids']

prompt_model.load_state_dict(state_dict)

# use the model
dataset = [
    InputExample(
        guid = 0,
        text_a = "I am sorry for your loss",
    ),
    InputExample(
        guid = 1,
        text_a = "It's not your fault",
    ),
]

data_loader = PromptDataLoader(dataset=dataset, 
                template=template, 
                tokenizer=tokenizer,
                tokenizer_wrapper_class=WrapperClass,
                max_seq_length=512,
                batch_size=2,
                shuffle=False,
                teacher_forcing=False,
                predict_eos_token=False,
                truncate_method='head')
prompt_model.eval()
with torch.no_grad():
    for batch in data_loader:
        logits = prompt_model(batch.to('cuda'))
        preds = torch.argmax(logits, dim = -1)
        print(preds) #[8, 5]

Runs of Blablablab empathy-appraisal-span on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About empathy-appraisal-span huggingface.co Model

More empathy-appraisal-span license Visit here:

https://choosealicense.com/licenses/cc-by-nc-sa-4.0

empathy-appraisal-span huggingface.co

empathy-appraisal-span huggingface.co is an AI model on huggingface.co that provides empathy-appraisal-span's model effect (), which can be used instantly with this Blablablab empathy-appraisal-span model. huggingface.co supports a free trial of the empathy-appraisal-span model, and also provides paid use of the empathy-appraisal-span. Support call empathy-appraisal-span model through api, including Node.js, Python, http.

empathy-appraisal-span huggingface.co Url

https://huggingface.co/Blablablab/empathy-appraisal-span

Blablablab empathy-appraisal-span online free

empathy-appraisal-span huggingface.co is an online trial and call api platform, which integrates empathy-appraisal-span's modeling effects, including api services, and provides a free online trial of empathy-appraisal-span, you can try empathy-appraisal-span online for free by clicking the link below.

Blablablab empathy-appraisal-span online free url in huggingface.co:

https://huggingface.co/Blablablab/empathy-appraisal-span

empathy-appraisal-span install

empathy-appraisal-span is an open source model from GitHub that offers a free installation service, and any user can find empathy-appraisal-span on GitHub to install. At the same time, huggingface.co provides the effect of empathy-appraisal-span install, users can directly use empathy-appraisal-span installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

empathy-appraisal-span install url in huggingface.co:

https://huggingface.co/Blablablab/empathy-appraisal-span

Url of empathy-appraisal-span

empathy-appraisal-span huggingface.co Url

Provider of empathy-appraisal-span huggingface.co

Blablablab
ORGANIZATIONS

Other API from Blablablab

huggingface.co

Total runs: 2.0K
Run Growth: -1.6K
Growth Rate: -75.19%
Updated:July 01 2026