failed09 commited on
Commit
e154be9
·
verified ·
1 Parent(s): 605b412

Improve model card and add citation

Browse files
Files changed (1) hide show
  1. README.md +56 -53
README.md CHANGED
@@ -14,79 +14,82 @@ tags:
14
 
15
  # BashkirRoBERTa
16
 
17
- BashkirRoBERTa is a 50M-parameter masked language model for Bashkir.
18
- It predicts a missing token from both sides of its context. The release includes
19
- the original 16,384-piece SentencePiece BPE tokenizer and an exact Pre-LayerNorm
20
- Transformer implementation.
21
 
22
- It is intended for fill-mask experiments and further fine-tuning. It is not a
23
- chat or text-generation model.
24
 
25
- ## Quick start
 
 
 
 
 
26
 
27
- ```python
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
- | Transformer blocks | 8, Pre-LayerNorm |
 
 
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
- | MLM head | tied to input embeddings |
56
 
57
- Special IDs are fixed: `<pad>` 0, `<unk>` 1, `<s>` 2, `</s>` 3, `[CLS]` 4,
58
- `[SEP]` 5, and `[MASK]` 6.
 
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. Public Bashkir
65
- Wikipedia is one component; the remaining source materials may carry separate
66
- terms. This release contains only model weights, code, and tokenizer assets.
67
 
68
- On a held-out Bashkir encyclopedic evaluation set, the project reports 24.7%
69
- top-1 and 54.0% top-5 accuracy for masked subword prediction. These results are
70
- diagnostic MLM measurements, not a general-purpose language understanding score.
71
 
72
- ## Limitations
73
 
74
- - A mask corresponds to one SentencePiece token, which may be a full word or a
75
- subword fragment.
76
- - The model can reflect errors, source bias, and rare memorized sequences from
77
- its training material. Do not use it to reconstruct non-public source text.
78
- - It has not been contrastively trained for semantic retrieval. Do not treat raw
79
- MLM outputs as sentence embeddings.
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  ## License and provenance
82
 
83
- The checkpoint is released under the repository's **custom terms** (`other` on
84
- the Hub) while the source-rights audit is completed. No training texts are
85
- redistributed. Please contact the maintainer through the Hub for provenance or
86
- removal requests before commercial redistribution.
87
 
88
- ## Reproducibility
89
 
90
- The original checkpoint was converted to `model.safetensors` without
91
- retraining. The included exporter verifies that the converted model produces
92
- exactly the same logits as the original checkpoint for a fixed inference input.
 
 
 
 
 
 
 
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
+ ```