Downloads · 30 days
2
1% of all-time downloads
tomatosauce-hg/sentiment-analysis-for-psychological-profiling
sentiment-analysis-for-psychological-profiling is a machine learning model from tomatosauce-hg. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Model ID: tomatosauce-hg/sentiment-analysis-for-psychological-profiling Base model: xlm-roberta-base (multilingual)
Downloads · 30 days
2
1% of all-time downloads
All-time downloads
347
Public
Parameters
278M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
Model ID: tomatosauce-hg/sentiment-analysis-for-psychological-profiling
Base model: xlm-roberta-base (multilingual)
A fine-tuned XLM-R sentence-level sentiment classifier targeted at short free-text responses to psychological questionnaire items. It handles English, Tagalog (Filipino), and Taglish (code-mixed) answers and returns one of three labels:
1 → POS (positive/hopeful/supportive tone)0 → NEG (negative/distressed/adverse tone)2 → NEU (neutral/mixed/descriptive tone)⚠️ Not a clinical tool. This model estimates sentiment only. Do not use it to diagnose or screen for mental health conditions.
from transformers import pipeline
model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
clf = pipeline(
"text-classification",
model=model_id,
tokenizer=model_id,
truncation=True,
top_k=None, # set to None to return only top label
return_all_scores=False
)
text = "Minsan nahihirapan pero kaya pa naman, sinusubukan kong mag-adjust."
print(clf(text))
# [{'label': 'POS', 'score': 0.83}] (example)
from transformers import pipeline
model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
clf = pipeline("text-classification", model=model_id, tokenizer=model_id, truncation=True)
question = "How do you usually react to life changes? How do you adjust?"
answer = "Nai-stress ako sa simula, pero inaayos ko routine ko at humihinga muna."
qa_text = f"[Q] {question}\n[A] {answer}"
print(clf(qa_text))
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
inputs = tok("Okay lang, unti-unti kong tinatanggap at inaayos.", return_tensors="pt", truncation=True)
logits = model(**inputs).logits
pred = torch.argmax(logits, dim=-1).item()
id2label = model.config.id2label # {'0':'POS','1':'NEG','2':'NEU'}
print(id2label[str(pred)])
The model was trained on answers to specific psychosocial questions. For best results:
If you know the prompt/question, feed [Q] ... [A] ...:
[Q] How do you view the world?
[A] Generally positive; may challenges pero kakayanin.
If you don’t have the question, passing the answer text alone still works.
Max length: 256 WordPiece tokens (XLM-R). Most responses are well under this length.
xlm-roberta-base2e-5Per-class (precision / recall / F1):
| Label | P | R | F1 | Support |
|---|---|---|---|---|
| POS (1) | 0.90 | 0.85 | 0.88 | 55 |
| NEG (0) | 0.79 | 0.88 | 0.83 | 51 |
| NEU (2) | 0.78 | 0.73 | 0.75 | 52 |
Observations
This repo includes:
config.json, model.safetensors, tokenizer filesTrainer on your dataset (same id2label/label2id mapping).Label mapping
"id2label": {"1": "POS", "0": "NEG", "2": "NEU"},
"label2id": {"POS": 1, "NEG": 0, "NEU": 2}
from transformers import pipeline
model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
clf = pipeline("text-classification", model=model_id, tokenizer=model_id, truncation=True)
batch = [
"Okay naman ako physically; minsan pagod lang.",
"Di ko gusto ang nangyayari, sobrang nakakapagod na.",
"Neutral lang—may good at bad, pero tuloy lang."
]
print([x['label'] for x in clf(batch)])
If you use this model, please cite:
@software{tomatosauce_hg_sentiment_psych_2025,
title = {Sentiment Analysis for Psychological Profiling (EN/TL/Taglish)},
author = {tomatosauce-hg},
year = {2025},
url = {https://huggingface.co/tomatosauce-hg/sentiment-analysis-for-psychological-profiling}
}
xlm-roberta-base (MIT).Open an issue on the model repo if you hit problems or have improvement ideas (e.g., real-data fine-tuning, calibration, question-aware prompts).