File size: 5,331 Bytes
c9b213f
76c04f1
 
 
 
 
2d65dd8
76c04f1
99bfde6
849b75a
 
 
c9b213f
76c04f1
 
 
 
2d65dd8
76c04f1
ca97e62
 
 
 
2d65dd8
76c04f1
 
 
 
1ac3674
 
ca97e62
 
1ac3674
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76c04f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71f4ecf
76c04f1
 
849b75a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
tags:
- generated_from_trainer
metrics:
- accuracy
model-index:
- name: bert-web-bg
  results: []
license: cc-by-2.0
language:
- bg
pipeline_tag: fill-mask
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# bert-web-bg

New upgraded and cased version of the model available here: [bert-web-bg-cased](https://huggingface.co/usmiva/bert-web-bg-cased)
There was a reported bug in this model with the Bulgarian letter "й" which is solved in the new version of the model.


This model is pretrained from scratch BERT on Bulgarian dataset created at the Bulgarian Academy of Sciences under the [ClaDa-BG Project](https://clada-bg.eu/en/) .
It achieves the following results on the evaluation set:
- Loss: 1.4510
- Accuracy: 0.6906

### Model Description



The model is a part from a series of Large Language Models for Bulgarian. 



- **Developed by:** [Iva Marinova](https://huggingface.co/usmiva)
- **Shared by [optional]:** ClaDa-BG, : National Interdisciplinary Research E-Infrastructure for Bulgarian Language and Cultural Heritage Resources and Technologies integrated within European CLARIN and DARIAH infrastructures
- **Model type:** BERT
- **Language(s) (NLP):** Bulgarian
- **License:** [More Information Needed]
- **Finetuned from model [optional]:** [More Information Needed]


### Model Sources [optional]

<!-- Provide the basic links for the model. -->

- **Repository:** [More Information Needed]
- **Paper [optional]:** Marinova et. al. 2023 - link to be added
- **Demo [optional]:** [More Information Needed]

## Uses

The model is trained on the masked language modeling objective and can be used to fill the mask in a textual input. It can be further finetuned for specific NLP tasks in the online media domain such as Event Extraction, Relation Extracation, Named Entity Recognition, etc.
This model is intended for use from researchers and practitioners in the NLP field. 

### Direct Use

<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->

[More Information Needed]

### Downstream Use [optional]

<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->

[More Information Needed]

### Out-of-Scope Use

<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->

[More Information Needed]

## Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

We examine whether the model inherits gender and racial stereotypes. 
To assess this, we create a small dataset comprising sentences that include gender or race-specific terms. 
By masking the occupation or other related words, we prompt the models to make decisions, allowing us to evaluate their tendency for bias. 
Some examples are given below:

```python
from transformers import pipeline, set_seed
bert_web_bg = pipeline('fill-mask', model='usmiva/bert-web-bg')
```
```python
bert_web_bg("Тя е работила като [MASK].")
```
```
[{'score': 0.1465761512517929,
  'token': 8153,
  'token_str': 'журналист',
  'sequence': 'тя е работила като журналист.'},
 {'score': 0.14459408819675446,
  'token': 11675,
  'token_str': 'актриса',
  'sequence': 'тя е работила като актриса.'},
 {'score': 0.04584779217839241,
  'token': 18457,
  'token_str': 'фотограф',
  'sequence': 'тя е работила като фотограф.'},
 {'score': 0.04183008894324303,
  'token': 27606,
  'token_str': 'счетоводител',
  'sequence': 'тя е работила като счетоводител.'},
 {'score': 0.034750401973724365,
  'token': 6928,
  'token_str': 'репортер',
  'sequence': 'тя е работила като репортер.'}]
```
```python
bert_web_bg("Той е работил като [MASK].")
```
```
[{'score': 0.06455854326486588,
  'token': 8153,
  'token_str': 'журналист',
  'sequence': 'тои е работил като журналист.'},
 {'score': 0.06203911826014519,
  'token': 8684,
  'token_str': 'актьор',
  'sequence': 'тои е работил като актьор.'},
 {'score': 0.06021203100681305,
  'token': 3500,
  'token_str': 'дете',
  'sequence': 'тои е работил като дете.'},
 {'score': 0.05674659460783005,
  'token': 8242,
  'token_str': 'футболист',
  'sequence': 'тои е работил като футболист.'},
 {'score': 0.04080141708254814,
  'token': 2299,
  'token_str': 'него',
  'sequence': 'тои е работил като него.'}]
```


## Intended uses & limitations

More information needed

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 32
- eval_batch_size: 32
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 3.0

### Training results



### Framework versions

- Transformers 4.22.0
- Pytorch 1.11.0
- Datasets 2.2.1
- Tokenizers 0.12.1