Fill-Mask
Transformers
ONNX
Safetensors
Bashkir
bashkir-roberta-preln
bashkir
masked-language-modeling
roberta
sentencepiece
custom-code
onnxruntime
custom_code
Instructions to use failed09/bashkir-roberta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use failed09/bashkir-roberta with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="failed09/bashkir-roberta", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForMaskedLM model = AutoModelForMaskedLM.from_pretrained("failed09/bashkir-roberta", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Improve model card and add citation
Browse files
README.md
CHANGED
|
@@ -14,79 +14,82 @@ tags:
|
|
| 14 |
|
| 15 |
# BashkirRoBERTa
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
-
chat or text-generation model.
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 29 |
-
|
| 30 |
-
repo_id = "failed09/bashkir-roberta"
|
| 31 |
-
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
|
| 32 |
-
model = AutoModelForMaskedLM.from_pretrained(repo_id, trust_remote_code=True)
|
| 33 |
-
|
| 34 |
-
inputs = tokenizer("Мин башҡорт телен [MASK].", return_tensors="pt")
|
| 35 |
-
logits = model(**inputs).logits
|
| 36 |
-
mask_index = inputs["input_ids"][0].tolist().index(tokenizer.mask_token_id)
|
| 37 |
-
top_id = logits[0, mask_index].argmax().item()
|
| 38 |
-
print(tokenizer.decode([top_id])) # яратам
|
| 39 |
-
```
|
| 40 |
-
|
| 41 |
-
`trust_remote_code=True` is required because this checkpoint uses a custom
|
| 42 |
-
Pre-LayerNorm architecture, not the post-LayerNorm implementation in the stock
|
| 43 |
-
`RobertaForMaskedLM` class.
|
| 44 |
-
|
| 45 |
-
## Architecture
|
| 46 |
|
| 47 |
| Property | Value |
|
| 48 |
-
|---|---
|
| 49 |
-
|
|
|
|
|
|
|
|
| 50 |
| Hidden size / attention heads | 640 / 10 |
|
| 51 |
| Feed-forward size | 2,560 |
|
| 52 |
| Context window | 256 subword tokens |
|
| 53 |
-
| Vocabulary | SentencePiece BPE, 16,384 tokens |
|
| 54 |
| Parameters | 50.04M |
|
| 55 |
-
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
`[
|
|
|
|
| 59 |
|
| 60 |
## Training and evaluation
|
| 61 |
|
| 62 |
The model was pretrained with dynamic masked-language modelling on a Bashkir
|
| 63 |
text collection assembled from encyclopedic, periodical, and literary sources.
|
| 64 |
-
The source texts are not distributed in this repository.
|
| 65 |
-
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
diagnostic MLM measurements, not a general-purpose language understanding score.
|
| 71 |
|
| 72 |
-
##
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
## License and provenance
|
| 82 |
|
| 83 |
-
The checkpoint is released under
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
removal requests before commercial redistribution.
|
| 87 |
|
| 88 |
-
##
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# BashkirRoBERTa
|
| 16 |
|
| 17 |
+
A masked language model for Bashkir. Given a sentence with one `[MASK]` token,
|
| 18 |
+
it predicts the most probable missing Bashkir token from its context. The model
|
| 19 |
+
is useful for fill-mask experiments and as a starting point for further
|
| 20 |
+
fine-tuning.
|
| 21 |
|
| 22 |
+
## Examples
|
|
|
|
| 23 |
|
| 24 |
+
| Input | Top prediction |
|
| 25 |
+
| --- | --- |
|
| 26 |
+
| `Башҡортостан — беҙҙең [MASK].` | `республика` |
|
| 27 |
+
| `Мин башҡорт телен [MASK].` | `яратам` |
|
| 28 |
+
| `Өфө — ҙур [MASK].` | `ҡала` |
|
| 29 |
+
| `Бөгөн Өфөлә яңы [MASK] асылды.` | `мәктәп` |
|
| 30 |
|
| 31 |
+
## Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
| Property | Value |
|
| 34 |
+
| --- | --- |
|
| 35 |
+
| Task | Masked language modelling / fill-mask |
|
| 36 |
+
| Architecture | Pre-LayerNorm Transformer encoder |
|
| 37 |
+
| Transformer blocks | 8 |
|
| 38 |
| Hidden size / attention heads | 640 / 10 |
|
| 39 |
| Feed-forward size | 2,560 |
|
| 40 |
| Context window | 256 subword tokens |
|
|
|
|
| 41 |
| Parameters | 50.04M |
|
| 42 |
+
| Tokenizer | SentencePiece BPE, 16,384 tokens |
|
| 43 |
|
| 44 |
+
The output embedding matrix is tied to the input word embeddings. Token IDs are
|
| 45 |
+
fixed: `<pad>` 0, `<unk>` 1, `<s>` 2, `</s>` 3, `[CLS]` 4, `[SEP]` 5, and
|
| 46 |
+
`[MASK]` 6.
|
| 47 |
|
| 48 |
## Training and evaluation
|
| 49 |
|
| 50 |
The model was pretrained with dynamic masked-language modelling on a Bashkir
|
| 51 |
text collection assembled from encyclopedic, periodical, and literary sources.
|
| 52 |
+
The source texts are not distributed in this repository. On a held-out Bashkir
|
| 53 |
+
encyclopedic evaluation set, the project reports 24.7% top-1 and 54.0% top-5
|
| 54 |
+
accuracy for masked subword prediction.
|
| 55 |
|
| 56 |
+
These are diagnostic MLM results, not a general-purpose language-understanding
|
| 57 |
+
score. A mask may represent a whole word or a SentencePiece subword fragment.
|
|
|
|
| 58 |
|
| 59 |
+
## Loading
|
| 60 |
|
| 61 |
+
```python
|
| 62 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 63 |
+
|
| 64 |
+
repo_id = "failed09/bashkir-roberta"
|
| 65 |
+
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
|
| 66 |
+
model = AutoModelForMaskedLM.from_pretrained(repo_id, trust_remote_code=True)
|
| 67 |
+
|
| 68 |
+
inputs = tokenizer("Мин башҡорт телен [MASK].", return_tensors="pt")
|
| 69 |
+
logits = model(**inputs).logits
|
| 70 |
+
mask_index = inputs["input_ids"][0].tolist().index(tokenizer.mask_token_id)
|
| 71 |
+
prediction_id = logits[0, mask_index].argmax().item()
|
| 72 |
+
print(tokenizer.decode([prediction_id])) # яратам
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
`trust_remote_code=True` is required: the model preserves the original custom
|
| 76 |
+
Pre-LayerNorm architecture rather than using the stock post-LayerNorm RoBERTa
|
| 77 |
+
implementation.
|
| 78 |
|
| 79 |
## License and provenance
|
| 80 |
|
| 81 |
+
The checkpoint is released under custom terms (`other` on the Hub) while the
|
| 82 |
+
source-rights audit is completed. No training texts are redistributed. For
|
| 83 |
+
provenance or removal requests, please contact the maintainer through the Hub.
|
|
|
|
| 84 |
|
| 85 |
+
## Citation
|
| 86 |
|
| 87 |
+
```bibtex
|
| 88 |
+
@model{failed09_bashkir_roberta_2026,
|
| 89 |
+
title = {BashkirRoBERTa},
|
| 90 |
+
author = {failed09},
|
| 91 |
+
year = {2026},
|
| 92 |
+
publisher = {Hugging Face},
|
| 93 |
+
url = {https://huggingface.co/failed09/bashkir-roberta}
|
| 94 |
+
}
|
| 95 |
+
```
|