| --- |
| license: mit |
| language: en |
| base_model: FacebookAI/roberta-large |
| pipeline_tag: text-classification |
| tags: |
| - emotion |
| - valence |
| - arousal |
| - memory |
| - LUFY |
| --- |
| |
| # LUFY — RoBERTa-large valence/arousal predictor |
|
|
| Fine-tuned `roberta-large` that predicts **valence** and **arousal** of a text (2-output regression), trained on [EmoBank](https://github.com/JULIELab/EmoBank). |
|
|
| This model is part of **[LUFY](https://github.com/ryuichi-sumida/LUFY)** — a RAG chatbot that selectively forgets unimportant conversations — where it estimates the emotional intensity of conversation turns as one signal of memory importance. See the paper: [Enhancing Long-term RAG Chatbots with Psychological Models of Memory Importance and Forgetting](https://arxiv.org/abs/2409.12524). |
|
|
| The companion conversation dataset is at [RuiSumida/LUFY (dataset)](https://huggingface.co/datasets/RuiSumida/LUFY). |
|
|
| ## Files |
|
|
| - `best_roberta_large.pth` — PyTorch `state_dict` for `RobertaForSequenceClassification` (`num_labels=2`, outputs `[valence, arousal]`) |
|
|
| ## Usage |
|
|
| ```python |
| import torch |
| from huggingface_hub import hf_hub_download |
| from transformers import RobertaTokenizer, RobertaForSequenceClassification |
| |
| model = RobertaForSequenceClassification.from_pretrained("roberta-large", num_labels=2) |
| model_path = hf_hub_download(repo_id="RuiSumida/LUFY", filename="best_roberta_large.pth") |
| model.load_state_dict(torch.load(model_path, map_location="cpu")) |
| model.eval() |
| |
| tokenizer = RobertaTokenizer.from_pretrained("roberta-large") |
| enc = tokenizer("I can't believe we won the finals!", max_length=128, |
| padding="max_length", truncation=True, return_tensors="pt") |
| with torch.no_grad(): |
| valence, arousal = model(**enc).logits.squeeze() |
| ``` |
|
|
| ## Citation |
|
|
| If you use this model, please cite the LUFY paper: https://arxiv.org/abs/2409.12524 |
|
|