Model reference · open weights
Longformer-es-mental-large is an open-weight embedding model from ELiRF. Longformer-es-mental-large (FP32) weighs 869 MB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the ELiRF/Longformer-es-mental-large model card, 2026-10-01
What it is
| Released by | ELiRF |
|---|---|
| Released | 2025-02-10 |
| Parameters | 435M |
| VRAM | 869 MB for the weights |
What it runs on
| Card | Runs | Memory |
|---|---|---|
| RTX 3060 12 GB | fits | 11.6 GB |
| RTX 4060 Ti 16 GB | fits | 15.4 GB |
| RTX 3090 24 GB | fits | 23.4 GB |
| RTX 4090 24 GB | fits | 23.4 GB |
| RTX 5090 32 GB | fits | 31.0 GB |
| L40S 48 GB | fits | 44.0 GB |
| A100 80 GB | fits | 78.2 GB |
| H100 80 GB | fits | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | fits | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
From the model card
Longformer-es-mental-large is a Spanish domain-adapted language model designed for the analysis of mental health–related content in long user-generated texts.
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 in mental health monitoring and early risk detection settings.
This model 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. The adaptation process allows the model to better capture emotional expressions, self-disclosure patterns, and discourse structures characteristic of mental health narratives in Spanish.
Longformer-es-mental-large is released as a foundational model and does not include task-specific fine-tuning.
This is the model card of a 🤗 transformers model that has been pushed on the Hub.
This model is intended for research purposes in the mental health NLP domain.
The model can be used directly as a feature extractor or encoder for Spanish mental health–related texts, particularly when long input sequences are required.
The model is primarily intended to be fine-tuned for downstream tasks such as:
It has been evaluated in early detection benchmarks when fine-tuned using task-specific datasets and methodologies.
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("ELiRF/Longformer-es-mental-large")
model = AutoModel.from_pretrained("ELiRF/Longformer-es-mental-large")
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 final dataset contains approximately 1.9 million posts from multiple mental health–related communities.
The model was trained using domain-adaptive pre-training (DAP) with a masked language modeling objective. Pre-training was performed for 20 epochs using multiple GPUs, following the same procedure applied to the other foundational models described in the paper “Improving Mental Health Screening and Early Risk Detection in Spanish”.
No task-specific fine-tuning is included in this checkpoint.
The model was evaluated after fine-tuning on Spanish mental health benchmarks (e.g., MentalRisk shared tasks).
When fine-tuned on Spanish mental health benchmarks, Longformer-es-mental shows competitive performance and improves upon the state of the art in both full-context (user-level) and early detection mental health tasks.
Longformer-es-mental is a Spanish domain-adapted long-context language model for mental health text analysis. It is based on the Longformer architecture and supports input sequences of up to 4096 tokens, enabling the modeling of long user message histories. The model shows strong performance on Spanish mental health detection and early risk detection tasks when fine-tuned on domain-specific datasets.
This model is part of ongoing research currently under review. The final version of the paper will be linked once it is published.
ELiRF research group (VRAIN, Universitat Politècnica de València)
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.