Update README.md
Browse files
README.md
CHANGED
|
@@ -11,4 +11,109 @@ tags:
|
|
| 11 |
|
| 12 |
# Sci-BETO-base
|
| 13 |
|
| 14 |
-
**Sci-BETO**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Sci-BETO-base
|
| 13 |
|
| 14 |
+
**Sci-BETO** is a domain-specific RoBERTa encoder pretrained entirely on **Spanish scientific texts**.
|
| 15 |
+
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
|
| 20 |
+
Sci-BETO-base is a transformer-based encoder following the **RoBERTa** architecture (125M parameters).
|
| 21 |
+
It was pretrained from scratch using byte-level BPE tokenization on a large corpus of **Spanish open-access scientific publications**, including theses, dissertations, and peer-reviewed papers from Colombian universities and international repositories.
|
| 22 |
+
|
| 23 |
+
The model was designed to capture **scientific discourse**, terminology, and abstract reasoning patterns typical of research documents in economics, engineering, medicine, and the social sciences.
|
| 24 |
+
|
| 25 |
+
| Property | Value |
|
| 26 |
+
|-----------|--------|
|
| 27 |
+
| Architecture | RoBERTa-base |
|
| 28 |
+
| Parameters | ~125M |
|
| 29 |
+
| Vocabulary size | 50,262 |
|
| 30 |
+
| Tokenizer | Byte-Level BPE (trained from scratch) |
|
| 31 |
+
| Pretraining objective | Masked Language Modeling (MLM) |
|
| 32 |
+
| Pretraining steps | 85K |
|
| 33 |
+
| Max sequence length | 512 tokens |
|
| 34 |
+
| Framework | Transformers |
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## Pretraining Data
|
| 39 |
+
|
| 40 |
+
The pretraining corpus includes over **11 billion tokens** from Spanish academic and scientific sources:
|
| 41 |
+
|
| 42 |
+
- Open-access repositories of Colombian universities (Universidad de los Andes, Universidad Nacional, Universidad Javeriana, Universidad del Rosario).
|
| 43 |
+
- CORE API and institutional repositories (theses, dissertations, working papers).
|
| 44 |
+
- Tax Statutes in Colombia
|
| 45 |
+
- Filtered and cleaned with:
|
| 46 |
+
- Language detection using FastText,
|
| 47 |
+
- Deduplication,
|
| 48 |
+
- Abstract and reference removal,
|
| 49 |
+
- Normalization of encoding and special symbols.
|
| 50 |
+
|
| 51 |
+
The final dataset covers multiple disciplines (economics, medicine, engineering, humanities), ensuring representation across scientific domains.
|
| 52 |
+
|
| 53 |
+
| **Source** | **# Documents** | **# Words (deduplicated)** | **Percentage (%)** |
|
| 54 |
+
|--------------------------------|----------------:|----------------------------:|-------------------:|
|
| 55 |
+
| Universidad de los Andes | 33,858 | 365,752,780 | 3.23 |
|
| 56 |
+
| Universidad Nacional | 44,686 | 537,022,975 | 4.75 |
|
| 57 |
+
| CORE API | 2,181,689 | 9,624,189,002 | 85.10 |
|
| 58 |
+
| Universidad del Rosario | 22,404 | 183,356,109 | 1.62 |
|
| 59 |
+
| Universidad Javeriana | 25,624 | 323,918,445 | 2.86 |
|
| 60 |
+
| Tax Statutes in Colombia | 392 | 13,924,060 | 0.12 |
|
| 61 |
+
| Extra | 2 | 261,131,453 | 2.31 |
|
| 62 |
+
| **Total** | **2,308,655** | **11,309,295,824** | **100.00** |
|
| 63 |
+
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
## Benchmarks
|
| 67 |
+
|
| 68 |
+
Sci-BETO was fine-tuned and benchmarked across multiple downstream tasks, both general-domain and scientific:
|
| 69 |
+
|
| 70 |
+
| **Dataset** | **Metric** | **Sci-BETO Large** | **Sci-BETO Base** | **BETO** | **BERTIN** | **XLM-RoBERTa Large** |
|
| 71 |
+
|--------------|-------------|-------------------:|------------------:|----------:|------------:|----------------------:|
|
| 72 |
+
| **WikiCAT** | F1 (macro) | **0.7738** | 0.7583 | 0.7624 | 0.7598 | — |
|
| 73 |
+
| **PAWS-X (es)** | F1 (macro) | **0.9148** | 0.8794 | 0.8985 | 0.8961 | — |
|
| 74 |
+
| **PharmaCoNER** | F1 (micro) | **0.8959** | 0.8733 | 0.8845 | 0.8802 | — |
|
| 75 |
+
| **CANTEMIST** | F1 (micro) | 0.8809 | 0.8784 | 0.8954 | **0.8956** | — |
|
| 76 |
+
| **NLI (ESNLI-R)** | F1 (micro) | — | — | — | — | — |
|
| 77 |
+
| **BanRep (JEL)** | Exact Match | **0.6116** | 0.6043 | 0.5933 | 0.5807 | — |
|
| 78 |
+
| **Rosario** | F1 (macro) | **0.9203** | 0.9194 | 0.9079 | 0.9121 | — |
|
| 79 |
+
| **Econ-IE** | F1 (micro) | **0.5256** | 0.5158 | 0.5199 | 0.4992 | — |
|
| 80 |
+
|
| 81 |
+
On average, **Sci-BETO** achieves comparable or superior results to general-domain Spanish models in specialized contexts (scientific, biomedical, economic), while maintaining strong performance in general text understanding.
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
## Intended Use
|
| 86 |
+
|
| 87 |
+
- Research and experimentation in **Spanish scientific NLP**.
|
| 88 |
+
- Downstream fine-tuning for:
|
| 89 |
+
- Text classification (scientific or academic domains),
|
| 90 |
+
- Named Entity Recognition (NER),
|
| 91 |
+
- Semantic similarity and paraphrase detection,
|
| 92 |
+
- Knowledge extraction from academic documents.
|
| 93 |
+
|
| 94 |
+
---
|
| 95 |
+
|
| 96 |
+
## Limitations
|
| 97 |
+
|
| 98 |
+
- The model may underperform on highly informal or non-academic Spanish (e.g., social media).
|
| 99 |
+
- It is not designed for generative tasks (e.g., text completion, chat).
|
| 100 |
+
- Domain bias toward academic register and Latin American Spanish variants.
|
| 101 |
+
- Pretraining corpus excludes English or bilingual data.
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## Example Usage
|
| 106 |
+
|
| 107 |
+
```python
|
| 108 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
| 109 |
+
|
| 110 |
+
tokenizer = AutoTokenizer.from_pretrained("Flaglab/Sci-BETO-base")
|
| 111 |
+
model = AutoModelForMaskedLM.from_pretrained("Flaglab/Sci-BETO-base")
|
| 112 |
+
|
| 113 |
+
text = "El Banco de la Republica va a subir las [mask] de interes."
|
| 114 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 115 |
+
outputs = model(**inputs)
|
| 116 |
+
logits = outputs.logits
|
| 117 |
+
masked_index = (inputs.input_ids == tokenizer.mask_token_id).nonzero(as_tuple=True)[1]
|
| 118 |
+
predicted_token = tokenizer.decode(logits[0, masked_index].argmax(dim=-1))
|
| 119 |
+
print("Predicted token:", predicted_token)
|