Downloads · 30 days
1.9K
95% of all-time downloads
ELiRF/Longformer-es-mental-base
Longformer-es-mental-base is a fill-mask model from ELiRF. Use it when you need the model to fill a missing word. It is set up for transformers.
Longformer-es-mental-base is the base-sized version of the Longformer-es-mental family, a Spanish domain-adapted language model designed for mental health text analysis on long user-generated content. The model is int…
Downloads · 30 days
1.9K
95% of all-time downloads
All-time downloads
2K
Public
Parameters
149M
8.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors595 MB · 99%
From the Hugging Face model README
Longformer-es-mental-base is the base-sized version of the Longformer-es-mental family, a Spanish domain-adapted language model designed for mental health text analysis on long user-generated content. The model is intended for scenarios where relevant mental health signals are distributed across multiple messages, such as social media timelines, forum threads, or user message histories.
It is based on the Longformer architecture, which extends the standard Transformer attention mechanism to efficiently process long sequences. The model supports input sequences of up to 4096 tokens, enabling it to capture long-range dependencies and temporal patterns that are particularly relevant for mental health screening tasks.
Longformer-es-mental-base was obtained through domain-adaptive pre-training (DAP) on a large corpus of mental health–related texts translated into Spanish from Reddit communities focused on psychological support and mental health discussions. This adaptation allows the model to better capture emotional expression, self-disclosure patterns, and discourse structures characteristic of mental health narratives in Spanish.
The model is released as a foundational model and does not include task-specific fine-tuning.
This model is intended for research purposes in the mental health NLP domain.
The model can be used directly as a language encoder or feature extractor for Spanish mental health–related texts when long input sequences are required and computational efficiency is a concern.
Longformer-es-mental-base is primarily intended to be fine-tuned for downstream tasks such as:
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("ELiRF/Longformer-es-mental-base")
model = AutoModel.from_pretrained("ELiRF/Longformer-es-mental-base")
inputs = tokenizer(
"Ejemplo de texto relacionado con salud mental.",
return_tensors="pt",
truncation=True,
max_length=4096
)
outputs = model(**inputs)
The model was domain-adapted using a merged corpus composed of:
All texts were automatically translated into Spanish using neural machine translation. The resulting dataset contains approximately 1.9 million posts from multiple mental health–related communities (e.g., depression, anxiety, suicide ideation, loneliness), providing broad coverage of informal mental health discourse.
The model was trained using domain-adaptive pre-training (DAP) with a masked language modeling objective.
No task-specific fine-tuning is included in this checkpoint.
When fine-tuned on Spanish mental health benchmarks, Longformer-es-mental-base shows competitive performance.
This model is part of an ongoing research project. The associated paper is currently under review and will be added to this model card once the publication process is completed.
ELiRF research group (VRAIN, Universitat Politècnica de València)