Downloads · 30 days
13
12% of all-time downloads
VictorYeste/human-value-detection-deberta-previous-sentences-2
human-value-detection-deberta-previous-sentences-2 is a machine learning model from VictorYeste. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model is the DeBERTa + 2 previous sentences value detector from the papers:
Downloads · 30 days
13
12% of all-time downloads
All-time downloads
109
Public
Parameters
139M
554 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors554 MB · 100%
From the Hugging Face model README
This model is the DeBERTa + 2 previous sentences value detector from the papers:
Human Values in a Single Sentence: Moral Presence, Hierarchies, and Transformer Ensembles on the Schwartz Continuum
Víctor Yeste, Paolo Rosso (2026), arXiv:2601.14172
Do Schwartz Higher-Order Values Help Sentence-Level Human Value Detection? When Hard Gating Hurts
Víctor Yeste, Paolo Rosso (2026), arXiv:2602.00913
It is a multi-label classifier over the 19 refined Schwartz basic values, trained on the English, machine-translated portion of the ValueEval'24 / ValuesML corpus, with two previous sentences incorporated as features.
microsoft/deberta-baseprev_label_features, size = 2 × 19)This checkpoint corresponds to the “Baseline + Previous-Sentences-2” feature-augmented model used in the paper and is one of the members of the best-performing DeBERTa ensemble.
⚠️ Important: In the paper, previous-sentence information is computed auto-regressively over each document (Text-ID). This Hugging Face model only contains the trained weights. To reproduce the full pipeline, please refer to the accompanying code repository.
The model was not trained or audited for safety-critical or high-stakes decision-making.
The 19 labels follow the refined Schwartz value continuum:
Self-direction: thoughtSelf-direction: actionStimulationHedonismAchievementPower: dominancePower: resourcesFaceSecurity: personalSecurity: societalTraditionConformity: rulesConformity: interpersonalHumilityBenevolence: caringBenevolence: dependabilityUniversalism: concernUniversalism: natureUniversalism: toleranceBecause this model uses a custom architecture (EnhancedDebertaForSequenceClassification) with a previous-sentence label branch, it is loaded via:
AutoModelForSequenceClassification(..., trust_remote_code=True)prev_label_features tensor of shape [batch_size, 2 * num_labels].If you just want to run the model on one sentence without context, you can pass a zero vector as prev_label_features.
This will run, but it will not fully match the paper’s setup (where prior labels are dynamic predictions from previous sentences in the same document).
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_id = "VictorYeste/human-value-detection-deberta-previous-sentences-2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(
model_id,
trust_remote_code=True, # important for custom model code
)
values = [
"Self-direction: thought",
"Self-direction: action",
"Stimulation",
"Hedonism",
"Achievement",
"Power: dominance",
"Power: resources",
"Face",
"Security: personal",
"Security: societal",
"Tradition",
"Conformity: rules",
"Conformity: interpersonal",
"Humility",
"Benevolence: caring",
"Benevolence: dependability",
"Universalism: concern",
"Universalism: nature",
"Universalism: tolerance",
]
id2label = {i: label for i, label in enumerate(values)}
def predict_values(text, prev_labels_vec=None, threshold=0.50):
enc = tokenizer(text, return_tensors="pt", truncation=True)
# Previous-sentence label features:
# vector of length 2 * num_labels (prev-1 and prev-2).
if prev_labels_vec is None:
prev_dim = 2 * model.config.num_labels
prev_labels_vec = [0.0] * prev_dim
prev_tensor = torch.tensor([prev_labels_vec], dtype=torch.float32)
with torch.no_grad():
outputs = model(**enc, prev_label_features=prev_tensor)
logits = outputs.logits.squeeze(0) # (19,)
probs = torch.sigmoid(logits) # tensor (19,)
probs = probs.cpu().numpy()
active = probs >= threshold
active_labels = [id2label[i] for i, is_on in enumerate(active) if is_on]
return {
"probs": {id2label[i]: float(p) for i, p in enumerate(probs)},
"labels": active_labels,
}
example = "We must do more to protect the environment and future generations."
print(predict_values(example))
This treats the sentence as if there were no informative previous sentences (all zero labels).
In the paper, for each document (Text-ID):
This requires an auto-regressive loop over the document. You can implement this yourself by:
For the exact implementation used in the paper (including text concatenation with tagged previous sentences), please see the accompanying GitHub repository.
The model was trained on the English, machine-translated portion of the ValueEval’24 / ValuesML dataset:
Important: the original dataset is distributed under a restricted Data Usage Agreement. You must obtain the data separately from the ValueEval/ValuesML organisers (e.g. via Zenodo) and respect their license.
This is the “Baseline + Previous-Sentences-2” context-aware configuration described in the paper.
On the English ValueEval’24 sentence-level splits, the paper compares:
For exact macro–F₁ scores and per-label results, please refer to:
Human Values in a Single Sentence: Moral Presence, Hierarchies, and Transformer Ensembles on the Schwartz Continuum Víctor Yeste, Paolo Rosso (2026), arXiv:2601.14172
Do Schwartz Higher-Order Values Help Sentence-Level Human Value Detection? When Hard Gating Hurts Víctor Yeste, Paolo Rosso (2026), arXiv:2602.00913
If you use this model, please:
The model weights and code in this repository are released under the Apache License 2.0.
This does not grant you any rights over the underlying training data (ValueEval/ValuesML). Please obtain and use that data under its own license and Data Usage Agreement.
If you use this model or the associated code in your research, please cite:
@misc{yeste2026humanvaluessinglesentence,
title={Human Values in a Single Sentence: Moral Presence, Hierarchies, and Transformer Ensembles on the Schwartz Continuum},
author={Víctor Yeste and Paolo Rosso},
year={2026},
eprint={2601.14172},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2601.14172},
}
@misc{yeste2026schwartzhigherordervalueshelp,
title={Do Schwartz Higher-Order Values Help Sentence-Level Human Value Detection? When Hard Gating Hurts},
author={Víctor Yeste and Paolo Rosso},
year={2026},
eprint={2602.00913},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2602.00913},
}
You may also want to cite the ValueEval / ValuesML dataset:
@misc{ValueEval24Zenodo,
author = {{The ValuesML Team}},
title = {Touch{\'e}24{-}ValueEval},
year = {2024},
month = {8},
version = {2024-08-09},
publisher = {Zenodo},
doi = {10.5281/zenodo.13283288},
url = {https://doi.org/10.5281/zenodo.13283288}
}