Text Classification
Transformers
TensorBoard
Safetensors
Spanish
longformer
spanish
mental-health
disorder-detection
mentalrisk2024
early-detection
ice
nlp
Instructions to use ELiRF/Longformer-es-m-base-ICE-MR24-DD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ELiRF/Longformer-es-m-base-ICE-MR24-DD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ELiRF/Longformer-es-m-base-ICE-MR24-DD")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ELiRF/Longformer-es-m-base-ICE-MR24-DD") model = AutoModelForSequenceClassification.from_pretrained("ELiRF/Longformer-es-m-base-ICE-MR24-DD", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
tags:
|
| 4 |
+
- spanish
|
| 5 |
+
- mental-health
|
| 6 |
+
- longformer
|
| 7 |
+
- disorder-detection
|
| 8 |
+
- mentalrisk2024
|
| 9 |
+
- early-detection
|
| 10 |
+
- ice
|
| 11 |
+
- nlp
|
| 12 |
+
language:
|
| 13 |
+
- es
|
| 14 |
+
base_model:
|
| 15 |
+
- ELiRF/Longformer-es-mental-base
|
| 16 |
+
---
|
| 17 |
+
# Model Card
|
| 18 |
+
|
| 19 |
+
## Model Description
|
| 20 |
+
|
| 21 |
+
Longformer-es-m-base-ICE-MR24-DD is a Spanish long-context language model for **mental disorder detection**, trained using the **Incremental Context Expansion (ICE)** methodology.
|
| 22 |
+
The model was developed for the **MentalRisk 2024 Disorder Detection (MR24-DD)** shared task and builds upon the **Longformer-es-mental-base** foundation model.
|
| 23 |
+
|
| 24 |
+
This model corresponds to the **base-sized version** of the ICE-adapted Longformer models.
|
| 25 |
+
Compared to its large counterpart, it contains **fewer parameters**, providing a more computationally efficient alternative while preserving the ability to process long user message histories.
|
| 26 |
+
|
| 27 |
+
The ICE methodology restructures the training data at the **context level**, enabling the model to learn from progressively expanding user message histories rather than complete user timelines.
|
| 28 |
+
This training strategy allows the model to better capture early and partial signals of mental health disorders, while remaining effective in **full-context (user-level)** evaluation settings.
|
| 29 |
+
|
| 30 |
+
The model is based on the Longformer architecture and supports input sequences of up to **4096 tokens**, making it suitable for disorder detection scenarios where evidence is distributed across long and heterogeneous user histories.
|
| 31 |
+
|
| 32 |
+
- Developed by: ELiRF group, VRAIN (Valencian Research Institute for Artificial Intelligence), Universitat Politècnica de València
|
| 33 |
+
- Shared by: ELiRF
|
| 34 |
+
- Model type: Transformer-based sequence classification model (Longformer)
|
| 35 |
+
- Language: Spanish
|
| 36 |
+
- Base model: Longformer-es-mental-base
|
| 37 |
+
- License: Same as base model
|
| 38 |
+
|
| 39 |
+
## Uses
|
| 40 |
+
|
| 41 |
+
This model is intended for **research purposes** in mental health disorder detection.
|
| 42 |
+
|
| 43 |
+
### Direct Use
|
| 44 |
+
|
| 45 |
+
The model can be used directly for **mental disorder detection** from Spanish user-generated content, producing predictions from incrementally available user message histories.
|
| 46 |
+
|
| 47 |
+
### Downstream Use
|
| 48 |
+
|
| 49 |
+
- Mental disorder detection (user-level classification)
|
| 50 |
+
- Early and incremental mental health screening
|
| 51 |
+
- Comparative studies on disorder detection methodologies
|
| 52 |
+
- Research on temporally-aware and incremental NLP models
|
| 53 |
+
|
| 54 |
+
### Out-of-Scope Use
|
| 55 |
+
|
| 56 |
+
- Automated intervention systems without human supervision
|
| 57 |
+
- Use on languages other than Spanish
|
| 58 |
+
- High-stakes decision-making affecting individuals’ health or safety
|
| 59 |
+
|
| 60 |
+
## ICE Methodology
|
| 61 |
+
|
| 62 |
+
Incremental Context Expansion (ICE) is a training methodology designed for early and incremental mental health detection tasks.
|
| 63 |
+
Instead of training models on full user histories, ICE generates **multiple incremental contexts per user**, each corresponding to a partial message history.
|
| 64 |
+
|
| 65 |
+
This approach enables the model to:
|
| 66 |
+
- Learn from incomplete and early evidence
|
| 67 |
+
- Improve robustness under early and incremental evaluation metrics
|
| 68 |
+
- Better align training conditions with real-world deployment scenarios
|
| 69 |
+
|
| 70 |
+
ICE modifies the dataset construction process while keeping the standard fine-tuning pipeline unchanged.
|
| 71 |
+
|
| 72 |
+
## Bias, Risks, and Limitations
|
| 73 |
+
|
| 74 |
+
- Training data originates from social media platforms and may contain demographic, cultural, and linguistic biases.
|
| 75 |
+
- Automatically translated texts may introduce translation artifacts or subtle semantic shifts.
|
| 76 |
+
- Disorder detection is inherently subjective and context-dependent.
|
| 77 |
+
- The model does not provide explanations or clinical interpretations of its predictions.
|
| 78 |
+
|
| 79 |
+
## How to Get Started with the Model
|
| 80 |
+
|
| 81 |
+
```python
|
| 82 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 83 |
+
|
| 84 |
+
tokenizer = AutoTokenizer.from_pretrained("ELiRF/Longformer-es-m-base-ICE-MR24-DD")
|
| 85 |
+
model = AutoModelForSequenceClassification.from_pretrained(
|
| 86 |
+
"ELiRF/Longformer-es-m-base-ICE-MR24-DD"
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
inputs = tokenizer(
|
| 90 |
+
"Ejemplo de historial de mensajes relacionado con salud mental.",
|
| 91 |
+
return_tensors="pt",
|
| 92 |
+
truncation=True,
|
| 93 |
+
max_length=4096
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
outputs = model(**inputs)
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
## Training Details
|
| 100 |
+
|
| 101 |
+
### Training Data
|
| 102 |
+
|
| 103 |
+
The model was fine-tuned on the **MentalRisk 2024 Disorder Detection (MR24-DD)** dataset.
|
| 104 |
+
Training data was restructured using the **ICE methodology**, generating incremental user contexts from original user timelines.
|
| 105 |
+
|
| 106 |
+
### Training Procedure
|
| 107 |
+
|
| 108 |
+
- Base model: Longformer-es-mental-base
|
| 109 |
+
- Fine-tuning strategy: ICE-based context-level training
|
| 110 |
+
- Objective: Sequence classification
|
| 111 |
+
- Training regime: fp16 mixed precision
|
| 112 |
+
|
| 113 |
+
## Evaluation
|
| 114 |
+
|
| 115 |
+
### Results
|
| 116 |
+
|
| 117 |
+
When evaluated on the MentalRisk 2024 Disorder Detection task, **Longformer-es-m-base-ICE-MR24-DD** shows **competitive performance** under both **full-context (user-level)** and **early / incremental detection** evaluation settings, offering a favorable trade-off between performance and computational efficiency.
|
| 118 |
+
|
| 119 |
+
## Environmental Impact
|
| 120 |
+
|
| 121 |
+
- Hardware type: NVIDIA A40 GPUs
|
| 122 |
+
- Training time: several hours (fine-tuning)
|
| 123 |
+
|
| 124 |
+
## Technical Specifications
|
| 125 |
+
|
| 126 |
+
### Model Architecture and Objective
|
| 127 |
+
|
| 128 |
+
- Architecture: Longformer (base)
|
| 129 |
+
- Objective: Sequence classification
|
| 130 |
+
- Maximum sequence length: 4096 tokens
|
| 131 |
+
- Model size: approximately 150M parameters
|
| 132 |
+
|
| 133 |
+
## Citation
|
| 134 |
+
|
| 135 |
+
This model is part of an ongoing research project.
|
| 136 |
+
The associated paper is currently under review and will be added to this model card once the publication process is completed.
|
| 137 |
+
|
| 138 |
+
## Model Card Authors
|
| 139 |
+
|
| 140 |
+
ELiRF research group (VRAIN, Universitat Politècnica de València)
|