Views
No views yet
tomatosauce-hg/sentiment-analysis-for-psychological-profiling
Base model: xlm-roberta-base (multilingual)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.
1from transformers import pipeline
2
3model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
4
5clf = pipeline(
6 "text-classification",
7 model=model_id,
8 tokenizer=model_id,
9 truncation=True,
10 top_k=None, # set to None to return only top label
11 return_all_scores=False
12)
13
14text = "Minsan nahihirapan pero kaya pa naman, sinusubukan kong mag-adjust."
15print(clf(text))
16# [{'label': 'POS', 'score': 0.83}] (example)1from transformers import pipeline
2
3model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
4clf = pipeline("text-classification", model=model_id, tokenizer=model_id, truncation=True)
5
6question = "How do you usually react to life changes? How do you adjust?"
7answer = "Nai-stress ako sa simula, pero inaayos ko routine ko at humihinga muna."
8qa_text = f"[Q] {question}\n[A] {answer}"
9
10print(clf(qa_text))1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
5tok = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForSequenceClassification.from_pretrained(model_id)
7
8inputs = tok("Okay lang, unti-unti kong tinatanggap at inaayos.", return_tensors="pt", truncation=True)
9logits = model(**inputs).logits
10pred = torch.argmax(logits, dim=-1).item()
11id2label = model.config.id2label # {'0':'POS','1':'NEG','2':'NEU'}
12print(id2label[str(pred)])[Q] ... [A] ...:[Q] How do you view the world?
[A] Generally positive; may challenges pero kakayanin.xlm-roberta-base2e-5| 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 |
config.json, model.safetensors, tokenizer filesTrainer on your dataset (same id2label/label2id mapping).1"id2label": {"1": "POS", "0": "NEG", "2": "NEU"},
2"label2id": {"POS": 1, "NEG": 0, "NEU": 2}1from transformers import pipeline
2
3model_id = "tomatosauce-hg/sentiment-analysis-for-psychological-profiling"
4clf = pipeline("text-classification", model=model_id, tokenizer=model_id, truncation=True)
5
6batch = [
7 "Okay naman ako physically; minsan pagod lang.",
8 "Di ko gusto ang nangyayari, sobrang nakakapagod na.",
9 "Neutral lang—may good at bad, pero tuloy lang."
10]
11print([x['label'] for x in clf(batch)])@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).