Update README.md
Browse files
README.md
CHANGED
|
@@ -7,11 +7,15 @@ base_model:
|
|
| 7 |
- BSC-LT/MrBERT
|
| 8 |
datasets:
|
| 9 |
- proxectonos/corpusnos
|
|
|
|
| 10 |
---
|
| 11 |
# MrBERT-nos-gl
|
| 12 |
|
| 13 |
-
MrBERT-nos-gl is a domain-adapted encoder model
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## Technical Description
|
| 17 |
|
|
@@ -48,7 +52,6 @@ MrBERT-nos-gl starts from the MrBERT base checkpoint and continues pre-training
|
|
| 48 |
| Eval MLM Mask Probability | 15% |
|
| 49 |
| Peak Learning Rate | 1e-5 |
|
| 50 |
| LR Scheduler | Warmup–Stable–Decay (WSD) |
|
| 51 |
-
| Warmup Budget | 3,000,000,000 tokens |
|
| 52 |
| Decay Budget | 0 tokens (no decay phase) |
|
| 53 |
| Final LR Factor (α_f) | 0.0 |
|
| 54 |
| Optimizer | Decoupled StableAdamW |
|
|
@@ -65,4 +68,47 @@ MrBERT-nos-gl starts from the MrBERT base checkpoint and continues pre-training
|
|
| 65 |
| Count Padding Tokens in Budget | No |
|
| 66 |
| Batch Size Warmup | From microbatch size up over 30M tokens |
|
| 67 |
| Attention Dropout | 0.0 (train) / 0.1 (output projection) |
|
| 68 |
-
| Seed | 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
- BSC-LT/MrBERT
|
| 8 |
datasets:
|
| 9 |
- proxectonos/corpusnos
|
| 10 |
+
pipeline_tag: fill-mask
|
| 11 |
---
|
| 12 |
# MrBERT-nos-gl
|
| 13 |
|
| 14 |
+
MrBERT-nos-gl is a domain-adapted encoder model obtained by continued pre-training of [BSC-LT/MrBERT](https://huggingface.co/BSC-LT/MrBERT) on [CorpusNÓS](https://huggingface.co/datasets/proxectonos/corpusnos), a large-scale Galician corpus (~1.9B tokens). It inherits MrBERT's ModernBERT architecture — with efficient long-context modeling (up to 1,024 tokens) via RoPE and sliding-window attention — and extends its coverage of Galician and Portuguese, two closely related Iberian languages underrepresented in most multilingual encoders.
|
| 15 |
+
|
| 16 |
+
The model is designed as a general-purpose encoder suitable for fine-tuning on downstream tasks such as named entity recognition, part-of-speech tagging, text classification, semantic similarity, question answering, and cross-lingual retrieval. It is the foundation for the [MrBERT-nos-gl model collection](https://huggingface.co/collections/proxectonos/mrbert-nos-gl).
|
| 17 |
+
|
| 18 |
+
Developed as part of **Proxecto Nós**, an initiative to build language technology for the Galician language.
|
| 19 |
|
| 20 |
## Technical Description
|
| 21 |
|
|
|
|
| 52 |
| Eval MLM Mask Probability | 15% |
|
| 53 |
| Peak Learning Rate | 1e-5 |
|
| 54 |
| LR Scheduler | Warmup–Stable–Decay (WSD) |
|
|
|
|
| 55 |
| Decay Budget | 0 tokens (no decay phase) |
|
| 56 |
| Final LR Factor (α_f) | 0.0 |
|
| 57 |
| Optimizer | Decoupled StableAdamW |
|
|
|
|
| 68 |
| Count Padding Tokens in Budget | No |
|
| 69 |
| Batch Size Warmup | From microbatch size up over 30M tokens |
|
| 70 |
| Attention Dropout | 0.0 (train) / 0.1 (output projection) |
|
| 71 |
+
| Seed | 17 |
|
| 72 |
+
|
| 73 |
+
## Usage
|
| 74 |
+
|
| 75 |
+
This model is a **base encoder** intended for fine-tuning, not for direct text generation. Load it with the `fill-mask` pipeline for masked language modeling, or use it as a backbone for downstream task fine-tuning.
|
| 76 |
+
|
| 77 |
+
### Installation
|
| 78 |
+
|
| 79 |
+
```bash
|
| 80 |
+
pip install transformers torch
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
### Masked language modeling
|
| 84 |
+
|
| 85 |
+
```python
|
| 86 |
+
from transformers import pipeline
|
| 87 |
+
|
| 88 |
+
mlm = pipeline("fill-mask", model="proxectonos/MrBERT-nos-gl")
|
| 89 |
+
|
| 90 |
+
results = mlm("A lingua galega é unha das linguas [MASK] de Europa.")
|
| 91 |
+
for r in results:
|
| 92 |
+
print(f"{r['token_str']:<20} {r['score']*100:.1f}%")
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Feature extraction / embeddings
|
| 96 |
+
|
| 97 |
+
```python
|
| 98 |
+
from transformers import AutoTokenizer, AutoModel
|
| 99 |
+
import torch
|
| 100 |
+
|
| 101 |
+
tokenizer = AutoTokenizer.from_pretrained("proxectonos/MrBERT-nos-gl")
|
| 102 |
+
model = AutoModel.from_pretrained("proxectonos/MrBERT-nos-gl")
|
| 103 |
+
|
| 104 |
+
inputs = tokenizer("A lingua galega é unha das linguas romances de Europa.", return_tensors="pt")
|
| 105 |
+
with torch.no_grad():
|
| 106 |
+
outputs = model(**inputs)
|
| 107 |
+
|
| 108 |
+
# Mean-pool the last hidden state for a sentence embedding
|
| 109 |
+
embeddings = outputs.last_hidden_state.mean(dim=1)
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
## Acknowledgements
|
| 113 |
+
|
| 114 |
+
This work is funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the project Desarrollo de Modelos ALIA. (Esta publicación del proyecto Desarrollo de Modelos ALIA está financiada por el Ministerio para la Transformación Digital y de la Función Pública y por el Plan de Recuperación, Transformación y Resiliencia – Financiado por la Unión Europea – NextGenerationEU)
|