Instructions to use masterkristall/rumodernbert_ner_ft_small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use masterkristall/rumodernbert_ner_ft_small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="masterkristall/rumodernbert_ner_ft_small")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("masterkristall/rumodernbert_ner_ft_small") model = AutoModelForTokenClassification.from_pretrained("masterkristall/rumodernbert_ner_ft_small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
RuModernBERT-small ner finetuned
Browse files- README.md +83 -0
- config.json +122 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +16 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: deepvk/RuModernBERT-small
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
metrics:
|
| 8 |
+
- f1
|
| 9 |
+
- precision
|
| 10 |
+
- recall
|
| 11 |
+
model-index:
|
| 12 |
+
- name: rumodernbert_ner_ft_small
|
| 13 |
+
results: []
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 17 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 18 |
+
|
| 19 |
+
# rumodernbert_ner_ft_small
|
| 20 |
+
|
| 21 |
+
This model is a fine-tuned version of [deepvk/RuModernBERT-small](https://huggingface.co/deepvk/RuModernBERT-small) on an unknown dataset.
|
| 22 |
+
It achieves the following results on the evaluation set:
|
| 23 |
+
- Loss: 0.2842
|
| 24 |
+
- F1: 0.8257
|
| 25 |
+
- Precision: 0.8080
|
| 26 |
+
- Recall: 0.8443
|
| 27 |
+
|
| 28 |
+
## Model description
|
| 29 |
+
|
| 30 |
+
More information needed
|
| 31 |
+
|
| 32 |
+
## Intended uses & limitations
|
| 33 |
+
|
| 34 |
+
More information needed
|
| 35 |
+
|
| 36 |
+
## Training and evaluation data
|
| 37 |
+
|
| 38 |
+
More information needed
|
| 39 |
+
|
| 40 |
+
## Training procedure
|
| 41 |
+
|
| 42 |
+
### Training hyperparameters
|
| 43 |
+
|
| 44 |
+
The following hyperparameters were used during training:
|
| 45 |
+
- learning_rate: 2e-05
|
| 46 |
+
- train_batch_size: 16
|
| 47 |
+
- eval_batch_size: 32
|
| 48 |
+
- seed: 42
|
| 49 |
+
- gradient_accumulation_steps: 2
|
| 50 |
+
- total_train_batch_size: 32
|
| 51 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 52 |
+
- lr_scheduler_type: linear
|
| 53 |
+
- lr_scheduler_warmup_steps: 0.1
|
| 54 |
+
- num_epochs: 10
|
| 55 |
+
- mixed_precision_training: Native AMP
|
| 56 |
+
|
| 57 |
+
### Training results
|
| 58 |
+
|
| 59 |
+
| Training Loss | Epoch | Step | Validation Loss | F1 | Precision | Recall |
|
| 60 |
+
|:-------------:|:-----:|:----:|:---------------:|:------:|:---------:|:------:|
|
| 61 |
+
| 1.3906 | 0.32 | 200 | 0.6057 | 0.4393 | 0.3840 | 0.5132 |
|
| 62 |
+
| 0.8110 | 0.64 | 400 | 0.3561 | 0.6269 | 0.5835 | 0.6774 |
|
| 63 |
+
| 0.6350 | 0.96 | 600 | 0.3008 | 0.7213 | 0.6812 | 0.7665 |
|
| 64 |
+
| 0.4992 | 1.28 | 800 | 0.2633 | 0.7803 | 0.7699 | 0.7909 |
|
| 65 |
+
| 0.3823 | 1.6 | 1000 | 0.2300 | 0.8084 | 0.7936 | 0.8238 |
|
| 66 |
+
| 0.3995 | 1.92 | 1200 | 0.2162 | 0.8009 | 0.7918 | 0.8102 |
|
| 67 |
+
| 0.2860 | 2.24 | 1400 | 0.2195 | 0.8109 | 0.7988 | 0.8234 |
|
| 68 |
+
| 0.2833 | 2.56 | 1600 | 0.2065 | 0.8140 | 0.7955 | 0.8335 |
|
| 69 |
+
| 0.2660 | 2.88 | 1800 | 0.2374 | 0.8145 | 0.8020 | 0.8274 |
|
| 70 |
+
| 0.1466 | 3.2 | 2000 | 0.2693 | 0.8079 | 0.7838 | 0.8335 |
|
| 71 |
+
| 0.1809 | 3.52 | 2200 | 0.2504 | 0.8299 | 0.8210 | 0.8391 |
|
| 72 |
+
| 0.1685 | 3.84 | 2400 | 0.2267 | 0.8315 | 0.8134 | 0.8503 |
|
| 73 |
+
| 0.0860 | 4.16 | 2600 | 0.2938 | 0.8273 | 0.8106 | 0.8447 |
|
| 74 |
+
| 0.0884 | 4.48 | 2800 | 0.2980 | 0.8183 | 0.7959 | 0.8419 |
|
| 75 |
+
| 0.1116 | 4.8 | 3000 | 0.2842 | 0.8257 | 0.8080 | 0.8443 |
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
### Framework versions
|
| 79 |
+
|
| 80 |
+
- Transformers 5.1.0
|
| 81 |
+
- Pytorch 2.10.0+cu128
|
| 82 |
+
- Datasets 4.7.0
|
| 83 |
+
- Tokenizers 0.22.2
|
config.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu",
|
| 3 |
+
"allow_embedding_resizing": true,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"ModernBertForTokenClassification"
|
| 6 |
+
],
|
| 7 |
+
"attention_bias": false,
|
| 8 |
+
"attention_dropout": 0.0,
|
| 9 |
+
"attention_layer": "rope",
|
| 10 |
+
"attention_probs_dropout_prob": 0.0,
|
| 11 |
+
"attn_out_bias": false,
|
| 12 |
+
"attn_out_dropout_prob": 0.1,
|
| 13 |
+
"attn_qkv_bias": false,
|
| 14 |
+
"bert_layer": "prenorm",
|
| 15 |
+
"bos_token_id": null,
|
| 16 |
+
"classifier_activation": "gelu",
|
| 17 |
+
"classifier_bias": false,
|
| 18 |
+
"classifier_dropout": 0.0,
|
| 19 |
+
"classifier_pooling": "cls",
|
| 20 |
+
"cls_token_id": 50281,
|
| 21 |
+
"compile_model": true,
|
| 22 |
+
"decoder_bias": true,
|
| 23 |
+
"deterministic_flash_attn": false,
|
| 24 |
+
"dtype": "float32",
|
| 25 |
+
"embed_dropout_prob": 0.0,
|
| 26 |
+
"embed_norm": true,
|
| 27 |
+
"embedding_dropout": 0.0,
|
| 28 |
+
"embedding_layer": "sans_pos",
|
| 29 |
+
"eos_token_id": null,
|
| 30 |
+
"final_norm": true,
|
| 31 |
+
"global_attn_every_n_layers": 3,
|
| 32 |
+
"head_pred_act": "gelu",
|
| 33 |
+
"hidden_act": "gelu",
|
| 34 |
+
"hidden_activation": "gelu",
|
| 35 |
+
"hidden_size": 384,
|
| 36 |
+
"id2label": {
|
| 37 |
+
"0": "O",
|
| 38 |
+
"1": "B-PER",
|
| 39 |
+
"2": "I-PER",
|
| 40 |
+
"3": "B-ORG",
|
| 41 |
+
"4": "I-ORG",
|
| 42 |
+
"5": "B-LOC",
|
| 43 |
+
"6": "I-LOC"
|
| 44 |
+
},
|
| 45 |
+
"init_method": "full_megatron",
|
| 46 |
+
"initializer_cutoff_factor": 2.0,
|
| 47 |
+
"initializer_range": 0.02,
|
| 48 |
+
"intermediate_size": 576,
|
| 49 |
+
"label2id": {
|
| 50 |
+
"B-LOC": 5,
|
| 51 |
+
"B-ORG": 3,
|
| 52 |
+
"B-PER": 1,
|
| 53 |
+
"I-LOC": 6,
|
| 54 |
+
"I-ORG": 4,
|
| 55 |
+
"I-PER": 2,
|
| 56 |
+
"O": 0
|
| 57 |
+
},
|
| 58 |
+
"layer_types": [
|
| 59 |
+
"full_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"full_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"full_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"sliding_attention",
|
| 68 |
+
"full_attention",
|
| 69 |
+
"sliding_attention",
|
| 70 |
+
"sliding_attention"
|
| 71 |
+
],
|
| 72 |
+
"local_attention": 256,
|
| 73 |
+
"local_attn_rotary_emb_base": 10000.0,
|
| 74 |
+
"loss_function": "fa_cross_entropy",
|
| 75 |
+
"loss_kwargs": {
|
| 76 |
+
"reduction": "mean"
|
| 77 |
+
},
|
| 78 |
+
"masked_prediction": true,
|
| 79 |
+
"max_position_embeddings": 8192,
|
| 80 |
+
"mlp_bias": false,
|
| 81 |
+
"mlp_dropout": 0.0,
|
| 82 |
+
"mlp_dropout_prob": 0.0,
|
| 83 |
+
"mlp_in_bias": false,
|
| 84 |
+
"mlp_layer": "glu",
|
| 85 |
+
"mlp_out_bias": false,
|
| 86 |
+
"model_type": "modernbert",
|
| 87 |
+
"norm_bias": false,
|
| 88 |
+
"norm_eps": 1e-05,
|
| 89 |
+
"norm_kwargs": {
|
| 90 |
+
"bias": false,
|
| 91 |
+
"eps": 1e-05
|
| 92 |
+
},
|
| 93 |
+
"normalization": "layernorm",
|
| 94 |
+
"num_attention_heads": 6,
|
| 95 |
+
"num_hidden_layers": 12,
|
| 96 |
+
"pad_token_id": 50283,
|
| 97 |
+
"padding": "unpadded",
|
| 98 |
+
"repad_logits_with_grad": false,
|
| 99 |
+
"rope_parameters": {
|
| 100 |
+
"full_attention": {
|
| 101 |
+
"rope_theta": 160000.0,
|
| 102 |
+
"rope_type": "default"
|
| 103 |
+
},
|
| 104 |
+
"sliding_attention": {
|
| 105 |
+
"rope_theta": 10000.0,
|
| 106 |
+
"rope_type": "default"
|
| 107 |
+
}
|
| 108 |
+
},
|
| 109 |
+
"rotary_emb_base": 160000.0,
|
| 110 |
+
"rotary_emb_dim": null,
|
| 111 |
+
"rotary_emb_interleaved": false,
|
| 112 |
+
"rotary_emb_scale_base": null,
|
| 113 |
+
"sep_token_id": 50282,
|
| 114 |
+
"skip_first_prenorm": true,
|
| 115 |
+
"sparse_pred_ignore_index": -100,
|
| 116 |
+
"sparse_prediction": false,
|
| 117 |
+
"tie_word_embeddings": true,
|
| 118 |
+
"transformers_version": "5.1.0",
|
| 119 |
+
"unpad_embeddings": true,
|
| 120 |
+
"use_cache": false,
|
| 121 |
+
"vocab_size": 50368
|
| 122 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4ced7cc9dfab7239745451679d0811a6a2cbf2a70874b519a50c31c664e9e1a
|
| 3 |
+
size 138175724
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"clean_up_tokenization_spaces": true,
|
| 4 |
+
"cls_token": "[CLS]",
|
| 5 |
+
"is_local": false,
|
| 6 |
+
"mask_token": "[MASK]",
|
| 7 |
+
"model_input_names": [
|
| 8 |
+
"input_ids",
|
| 9 |
+
"attention_mask"
|
| 10 |
+
],
|
| 11 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 12 |
+
"pad_token": "[PAD]",
|
| 13 |
+
"sep_token": "[SEP]",
|
| 14 |
+
"tokenizer_class": "TokenizersBackend",
|
| 15 |
+
"unk_token": "[UNK]"
|
| 16 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fdd24b1aaf09472a19daaeb68d733040305aab072a68a23a778e9aa05546f6c5
|
| 3 |
+
size 5201
|