Downloads · 30 days
10
1% of all-time downloads
dominguesm/positive-reframing-ptbr
positive-reframing-ptbr is a machine learning model from dominguesm. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-4.0.
This model is a PTT5 adjusted to the sentiment transfer task, where the objective is to reverse the sentiment polarity of a text without contradicting the original meaning. Positive reframing induces a complementary p…
Downloads · 30 days
10
1% of all-time downloads
All-time downloads
988
Public
Parameters
223M
2.7 GB on disk
Likes
3
Public
Click a slice to open those files.
.bin892 MB · 50%
From the Hugging Face model README
This model is a PTT5 adjusted to the sentiment transfer task, where the objective is to reverse the sentiment polarity of a text without contradicting the original meaning. Positive reframing induces a complementary positive viewpoint (e.g. glass-half-full) escaping negative patterns. Based on the article arXiv:2204.02952.
The model uses one or more sentiment strategies concatenated with a sentence and will generate a sentence with the applied sentiment output. The maximum string length is 1024 tokens. Entries must be organized in the following format:
"['thankfulness', 'optimism']: Tenho tanta coisa para fazer antes de sair da cidade por uma semana no domingo."
growth: viewing a challenging event as an opportunity for the author to specifically grow or improve himself.
impermanence: Saying that bad things don't last forever, will get better soon, and/or that other people have had similar difficulties.
neutralizing: Replacing a negative word with a neutral word. For example, “This was a terrible day” becomes “This was a long day”.
optimism: Focusing on things about the situation itself, at that moment, that are good (not just predicting a better future).
self_affirmation: Talking about what strengths the author already has, or values he admires, such as love, courage, perseverance, etc.
thankfulness: Expressing gratitude or gratitude with keywords like appreciate, happy for it, grateful for, good thing, etc.
from transformers import pipeline
pipe = pipeline('summarization', "dominguesm/positive-reframing-ptbr")
text = "['thankfulness', 'optimism']: Tenho tanta coisa para fazer antes de sair da cidade por uma semana no domingo."
pipe(text, max_length=1024)