Views
No views yet
1>>> from transformers import (
2>>> PreTrainedTokenizerFast,
3>>> ModernBertForMaskedLM,
4>>> pipeline
5>>> )
6
7>>> model = ModernBertForMaskedLM.from_pretrained('AIaLT-IICT/modern_bert_bg_base_uncased')
8>>> tokenizer = PreTrainedTokenizerFast.from_pretrained('AIaLT-IICT/modern_bert_bg_base_uncased')
9
10>>> fill_mask = pipeline(
11>>> "fill-mask",
12>>> model=model,
13>>> tokenizer=tokenizer
14>>> )
15
16
17>>> fill_mask("Заради 3 завода няма да [MASK] нито есенниците неподхранени, нито зърното да поскъпне заради тях.")
18
19[{'score': 0.24791079759597778,
20 'token': 26913,
21 'token_str': 'оставим',
22 'sequence': 'заради 3 завода няма да оставим нито есенниците неподхранени, нито зърното да поскъпне заради тях.'},
23 {'score': 0.1209656149148941,
24 'token': 35612,
25 'token_str': 'допуснем',
26 'sequence': 'заради 3 завода няма да допуснем нито есенниците неподхранени, нито зърното да поскъпне заради тях.'},
27 {'score': 0.10752104222774506,
28 'token': 17875,
29 'token_str': 'останат',
30 'sequence': 'заради 3 завода няма да останат нито есенниците неподхранени, нито зърното да поскъпне заради тях.'},
31 {'score': 0.09038839489221573,
32 'token': 12941,
33 'token_str': 'има',
34 'sequence': 'заради 3 завода няма да има нито есенниците неподхранени, нито зърното да поскъпне заради тях.'},
35 {'score': 0.0655432641506195,
36 'token': 15017,
37 'token_str': 'остави',
38 'sequence': 'заради 3 завода няма да остави нито есенниците неподхранени, нито зърното да поскъпне заради тях.'}]1@inproceedings{simov-etal-2026-small,
2 title = {Small Can Be Beautiful in LLMs for SSH: a Case for Bulgarian },
3 author = {Simov, Kiril and Paev, Nikolay and Osenova, Petya and Valchev, Teodor and Marinov, Stefan},
4 booktitle = {Proceedings of Shaping Multilingual, Multimodal AI for the Social Sciences and Humanities (LLMs4SSH) @ LREC 2026},
5 month = {May},
6 year = {2026},
7 pages = {187--197},
8 address = {Palma, Mallorca, Spain},
9 publisher = {European Language Resources Association (ELRA)},
10 editor = {Montejo-Raez, Arturo and Grisot, Cristina and Blochowiak, Joanna and Ljubešić, Nikola and Battaner, Elena and Rigau, German},
11 doi = {10.63317/5n9bq7g3it2s},
12 abstract = {In the paper we present a set of small LLM-based models for solving the basic NLP tasks for Bulgarian - POS tagging, Lemmatization, Dependency parsing, Named Entity Recognition, Named Entity Linking, Event Annotation, among others. In order to create fine-tuned models for these tasks, we first pre-train models using architectures like BERT, Modern-BERT, and T5 with different sizes, over Bulgarian data only. For each of the tasks we report our approach towards the fine-tuning, the results from the experiments and also the evaluation. Then we define a way to visualize the results over HTML documents which contain the analyzed texts. Our rationale are as follows: most, if not all SSH research scenarios, need a reliable processing chains that can be customized with respect to the specific needs. These scenarios also would need proper visualization for human observation. We aim to provide such a basic LLM-based toolkit.}
13}