Sentence Similarity
sentence-transformers
Safetensors
Serbian
xlm-roberta
wsd
word-sense-disambiguation
serbian
knowledge-distillation
text-embeddings-inference
Instructions to use Tanor/serbian-wsd-distilled-e5-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Tanor/serbian-wsd-distilled-e5-large with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Tanor/serbian-wsd-distilled-e5-large") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Cite the dissertation and clarify the scope of archive observations
Browse files- README.md +36 -14
- provenance.json +86 -60
README.md
CHANGED
|
@@ -19,7 +19,7 @@ tags:
|
|
| 19 |
|
| 20 |
This is a Sentence Transformers bi-encoder adapted by **[Saša Petalinkar](https://orcid.org/0009-0007-9664-3594)** from [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) for **Serbian word-sense candidate ranking**. Given a sentence context and externally supplied candidate definitions, it ranks the candidates by cosine similarity. Its experiment preset is `mling`.
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
## Model and intended use
|
| 25 |
|
|
@@ -68,13 +68,13 @@ best = int(scores.argmax().item())
|
|
| 68 |
print(candidates[best][0])
|
| 69 |
```
|
| 70 |
|
| 71 |
-
The exact prefix `query: ` is required on **both** the context and candidate definitions to follow the experiment; do not substitute `passage: ` for definitions. Saved query/document prompts are empty strings, so loading the model does not apply this prefix automatically. For normal inference, use sentence-relative character offsets to surround the intended target with `**...**`.
|
| 72 |
|
| 73 |
## Training and checkpoint selection
|
| 74 |
|
| 75 |
Training uses hard silver sense assignments from the LexiSense annotation pipeline. A context-definition pair has label 1 for the assigned sense and label 0 for other listed candidates. Candidates lacking definitions are skipped. Despite the experiment's “distillation” name, the implemented objective is hard-label cosine regression, without teacher logits, soft-label matching, temperature scaling, or KL divergence.
|
| 76 |
|
| 77 |
-
The retained training-pair file contains **38,829 pairs**: 10,385 positive and 28,444 negative, covering 1,604 distinct sentence strings and five source-file values. All designated gold sentence texts were excluded by exact matching. A publication audit found zero exact overlaps with the 420 distinct sentence strings in the four retained gold files. This does not establish absence of near-duplicates or other leakage. The
|
| 78 |
|
| 79 |
| Recorded setting | Value |
|
| 80 |
|---|---|
|
|
@@ -92,17 +92,11 @@ Generated trainer metadata records learning rate `5e-5`, linear scheduling, `ada
|
|
| 92 |
|
| 93 |
Recorded software: Python 3.11.9, Sentence Transformers 5.5.0, Transformers 5.8.1, PyTorch 2.11.0+cu128, Accelerate 1.13.0, Datasets 4.8.5, and Tokenizers 0.22.2.
|
| 94 |
|
| 95 |
-
##
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
## Retained experiment results
|
| 102 |
-
|
| 103 |
-
The handoff reports **1394/1921 correct (72.57% strict top-1)** for the `mling` trained experiment. It reports 1,894 covered targets and 73.60% covered-only accuracy. The final universe comprises 1,734 single-word targets and 187 multiword expressions. Strict accuracy counts the 27 uncovered targets as wrong; the retained report attributes them to missing candidate definitions.
|
| 104 |
-
|
| 105 |
-
**These are historical experiment results, not independently verified metrics for this exact release.** The retained evaluation summary lacks checkpoint hashes and exact checkpoint paths, leaving its connection to this specific weight file unresolved.
|
| 106 |
|
| 107 |
The workbook evaluator adds the gold sense when it is absent from the supplied candidate set. Accordingly, these results measure ranking with a **gold-augmented candidate inventory**, not end-to-end candidate recall. One-candidate cases are answered deterministically without the encoder. These protocol choices matter when comparing other systems.
|
| 108 |
|
|
@@ -110,11 +104,17 @@ The workbook evaluator adds the gold sense when it is absent from the supplied c
|
|
| 110 |
|
| 111 |
A local CPU smoke test on 2026-09-27 loaded these exact weights and executed the Python example above. It produced finite embeddings of the expected dimensions. The example selected the leaf sense although the synthetic sentence refers to paper. A successful technical load therefore should not be confused with successful disambiguation. See [runtime_verification.json](runtime_verification.json) for the observed scores. This is a three-text technical check, not an accuracy evaluation or a replication of the historical results.
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
## Provenance, attribution, and license
|
| 114 |
|
| 115 |
The weights were adapted by **[Saša Petalinkar](https://orcid.org/0009-0007-9664-3594)**. Credit for the base model and its original authors belongs to the contributors identified in the [upstream model card](https://huggingface.co/intfloat/multilingual-e5-large). This adaptation is distributed under [MIT License](https://opensource.org/license/mit); see the included license files and preserve upstream attribution.
|
| 116 |
|
| 117 |
-
[Companion implementation and reported settings, v0.1.0](https://github.com/sasa5linkar/serbian-wsd-distillation/tree/v0.1.0) document the workflow. That
|
| 118 |
|
| 119 |
See [provenance.json](provenance.json) and [recorded_training_summary.json](recorded_training_summary.json) for packaged metadata. The released `model.safetensors` SHA-256 is:
|
| 120 |
|
|
@@ -122,4 +122,26 @@ See [provenance.json](provenance.json) and [recorded_training_summary.json](reco
|
|
| 122 |
dc0cff1db0f5bf5072bf89b82b00b81cc30893d073914c8ce1d9b1f31a3b6b36
|
| 123 |
```
|
| 124 |
|
| 125 |
-
The checksum identifies the released
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
This is a Sentence Transformers bi-encoder adapted by **[Saša Petalinkar](https://orcid.org/0009-0007-9664-3594)** from [intfloat/multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) for **Serbian word-sense candidate ranking**. Given a sentence context and externally supplied candidate definitions, it ranks the candidates by cosine similarity. Its experiment preset is `mling`.
|
| 21 |
|
| 22 |
+
This checkpoint accompanies **Saša Z. Petalinkar's doctoral dissertation (University of Belgrade, 2026)**. The distillation method is described in **Section 3.4**, and the experiment results are reported in **Section 5.8**. See [Thesis and citation](#thesis-and-citation) for the full reference.
|
| 23 |
|
| 24 |
## Model and intended use
|
| 25 |
|
|
|
|
| 68 |
print(candidates[best][0])
|
| 69 |
```
|
| 70 |
|
| 71 |
+
The exact prefix `query: ` is required on **both** the context and candidate definitions to follow the experiment; do not substitute `passage: ` for definitions. Saved query/document prompts are empty strings, so loading the model does not apply this prefix automatically. For normal inference, use sentence-relative character offsets to surround the intended target with `**...**`. Return the only candidate directly for a one-candidate item; for ambiguous items, all candidate definitions are required by the recorded evaluation protocol.
|
| 72 |
|
| 73 |
## Training and checkpoint selection
|
| 74 |
|
| 75 |
Training uses hard silver sense assignments from the LexiSense annotation pipeline. A context-definition pair has label 1 for the assigned sense and label 0 for other listed candidates. Candidates lacking definitions are skipped. Despite the experiment's “distillation” name, the implemented objective is hard-label cosine regression, without teacher logits, soft-label matching, temperature scaling, or KL divergence.
|
| 76 |
|
| 77 |
+
The retained training-pair file contains **38,829 pairs**: 10,385 positive and 28,444 negative, covering 1,604 distinct sentence strings and five source-file values. All designated gold sentence texts were excluded by exact matching. A publication audit found zero exact overlaps with the 420 distinct sentence strings in the four retained gold files. This does not establish absence of near-duplicates or other leakage. The inspected training-file hash is recorded in the packaged provenance; see the archive inspection note below.
|
| 78 |
|
| 79 |
| Recorded setting | Value |
|
| 80 |
|---|---|
|
|
|
|
| 92 |
|
| 93 |
Recorded software: Python 3.11.9, Sentence Transformers 5.5.0, Transformers 5.8.1, PyTorch 2.11.0+cu128, Accelerate 1.13.0, Datasets 4.8.5, and Tokenizers 0.22.2.
|
| 94 |
|
| 95 |
+
## Results reported in the dissertation
|
| 96 |
|
| 97 |
+
The dissertation (Section 5.8, Table 5-16) reports **1,394/1,921 correct (72.6% strict top-1)** for the trained `multilingual-e5-large` model (`mling` in the experiment code). The retained experiment summary records 1,894 covered targets and 73.60% covered-only accuracy. The final universe comprises 1,734 single-word targets and 187 multiword expressions. Strict accuracy counts the 27 uncovered targets as wrong; the retained report attributes them to missing candidate definitions.
|
| 98 |
|
| 99 |
+
These figures are the results reported in the dissertation and agree with the retained experiment summary. The selected epochs and development scores in the saved training records agree with the experiment handoff. The full evaluation was not rerun for this Hub release; the release check below verifies model loading and a small inference example.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
The workbook evaluator adds the gold sense when it is absent from the supplied candidate set. Accordingly, these results measure ranking with a **gold-augmented candidate inventory**, not end-to-end candidate recall. One-candidate cases are answered deterministically without the encoder. These protocol choices matter when comparing other systems.
|
| 102 |
|
|
|
|
| 104 |
|
| 105 |
A local CPU smoke test on 2026-09-27 loaded these exact weights and executed the Python example above. It produced finite embeddings of the expected dimensions. The example selected the leaf sense although the synthetic sentence refers to paper. A successful technical load therefore should not be confused with successful disambiguation. See [runtime_verification.json](runtime_verification.json) for the observed scores. This is a three-text technical check, not an accuracy evaluation or a replication of the historical results.
|
| 106 |
|
| 107 |
+
## Archive inspection note
|
| 108 |
+
|
| 109 |
+
In the retained `silver_pairs.jsonl`, 38,727 of 38,829 pairs place the target markers at the end of the sentence rather than around the target span; 102 pairs contain a nonempty `**...**` span. The original checkpoint cards show the same format in their training examples, and their training configurations refer to this pair file. The exact count describes the retained file inspected during release preparation. The effect of this marking format on model performance was not separately measured.
|
| 110 |
+
|
| 111 |
+
The retained Round 2 evaluation summary does not record weight-file checksums. The checksums in this release identify the uploaded files; the research results above are attributed to the dissertation and its experiment records.
|
| 112 |
+
|
| 113 |
## Provenance, attribution, and license
|
| 114 |
|
| 115 |
The weights were adapted by **[Saša Petalinkar](https://orcid.org/0009-0007-9664-3594)**. Credit for the base model and its original authors belongs to the contributors identified in the [upstream model card](https://huggingface.co/intfloat/multilingual-e5-large). This adaptation is distributed under [MIT License](https://opensource.org/license/mit); see the included license files and preserve upstream attribution.
|
| 116 |
|
| 117 |
+
[Companion implementation and reported settings, v0.1.0](https://github.com/sasa5linkar/serbian-wsd-distillation/tree/v0.1.0) document the workflow. That repository is the public software companion to the dissertation experiments.
|
| 118 |
|
| 119 |
See [provenance.json](provenance.json) and [recorded_training_summary.json](recorded_training_summary.json) for packaged metadata. The released `model.safetensors` SHA-256 is:
|
| 120 |
|
|
|
|
| 122 |
dc0cff1db0f5bf5072bf89b82b00b81cc30893d073914c8ce1d9b1f31a3b6b36
|
| 123 |
```
|
| 124 |
|
| 125 |
+
The checksum identifies the released weight file. Training corpora and external definition inventories are not included in this model repository.
|
| 126 |
+
|
| 127 |
+
## Thesis and citation
|
| 128 |
+
|
| 129 |
+
[Saša Z. Petalinkar](https://orcid.org/0009-0007-9664-3594) (2026). *Machine Learning and Large Language Models in the Development of Semantic Networks and Their Application in Automatic Text Understanding*. Doctoral dissertation manuscript, University of Belgrade. Written in Serbian.
|
| 130 |
+
|
| 131 |
+
Original title: *Машинско учење и велики језички модели у развоју семантичких мрежа и њиховој примени на аутоматско разумевање текста*.
|
| 132 |
+
|
| 133 |
+
- **Section 3.4, „Разрешење значења речи – дестилација“**: distillation method and experimental setup.
|
| 134 |
+
- **Section 5.8, „Резултати дестилације модела за разрешење значења речи“, Table 5-16**: reported results for the `simple`, `tesla`, and `multilingual-e5-large` rankers. The last is called `mling` in the experiment code. Table 5-17 reports the paired significance tests.
|
| 135 |
+
- **Section 5.6, Table 5-10**: mapping of the dissertation's model names to the pretrained checkpoints.
|
| 136 |
+
|
| 137 |
+
The manuscript does not currently have a public URL or DOI. The [public software companion](https://github.com/sasa5linkar/serbian-wsd-distillation/tree/v0.1.0) contains the implementation, reported settings, and result summaries.
|
| 138 |
+
|
| 139 |
+
```bibtex
|
| 140 |
+
@unpublished{petalinkar2026semanticnetworks,
|
| 141 |
+
author = {Petalinkar, Saša Z.},
|
| 142 |
+
title = {Машинско учење и велики језички модели у развоју семантичких мрежа и њиховој примени на аутоматско разумевање текста},
|
| 143 |
+
year = {2026},
|
| 144 |
+
note = {Doctoral dissertation manuscript, University of Belgrade. Sections 3.4 and 5.8; Table 5-16},
|
| 145 |
+
language = {Serbian}
|
| 146 |
+
}
|
| 147 |
+
```
|
provenance.json
CHANGED
|
@@ -1,60 +1,86 @@
|
|
| 1 |
-
{
|
| 2 |
-
"repo_id": "Tanor/serbian-wsd-distilled-e5-large",
|
| 3 |
-
"preset": "mling",
|
| 4 |
-
"release_date": "2026-09-27",
|
| 5 |
-
"base_model": "intfloat/multilingual-e5-large",
|
| 6 |
-
"base_revision_observed_at_preparation": "3d7cfbdacd47fdda877c5cd8a79fbcc4f2a574f3",
|
| 7 |
-
"base_metadata_observed_date": "2026-09-25",
|
| 8 |
-
"historical_base_revision_verified": false,
|
| 9 |
-
"license": "mit",
|
| 10 |
-
"weights": {
|
| 11 |
-
"file": "model.safetensors",
|
| 12 |
-
"sha256": "dc0cff1db0f5bf5072bf89b82b00b81cc30893d073914c8ce1d9b1f31a3b6b36",
|
| 13 |
-
"size_bytes": 2239607176,
|
| 14 |
-
"stored_dtype": [
|
| 15 |
-
"F32"
|
| 16 |
-
]
|
| 17 |
-
},
|
| 18 |
-
"checkpoint_selection": {
|
| 19 |
-
"best_epoch": 7,
|
| 20 |
-
"orchestration_seed": 20260515,
|
| 21 |
-
"criterion": "development covered-only top-1 accuracy"
|
| 22 |
-
},
|
| 23 |
-
"training_pair_file_audit": {
|
| 24 |
-
"sha256": "0b0965273203a5285ce6bcc2638095306a77f6171063e455fa47aebc37836eda",
|
| 25 |
-
"pairs": 38829,
|
| 26 |
-
"positive": 10385,
|
| 27 |
-
"negative": 28444,
|
| 28 |
-
"distinct_sentence_strings": 1604,
|
| 29 |
-
"empty_trailing_target_markers": 38727,
|
| 30 |
-
"nonempty_marked_spans": 102,
|
| 31 |
-
"historical_input_identity_verified": false
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"repo_id": "Tanor/serbian-wsd-distilled-e5-large",
|
| 3 |
+
"preset": "mling",
|
| 4 |
+
"release_date": "2026-09-27",
|
| 5 |
+
"base_model": "intfloat/multilingual-e5-large",
|
| 6 |
+
"base_revision_observed_at_preparation": "3d7cfbdacd47fdda877c5cd8a79fbcc4f2a574f3",
|
| 7 |
+
"base_metadata_observed_date": "2026-09-25",
|
| 8 |
+
"historical_base_revision_verified": false,
|
| 9 |
+
"license": "mit",
|
| 10 |
+
"weights": {
|
| 11 |
+
"file": "model.safetensors",
|
| 12 |
+
"sha256": "dc0cff1db0f5bf5072bf89b82b00b81cc30893d073914c8ce1d9b1f31a3b6b36",
|
| 13 |
+
"size_bytes": 2239607176,
|
| 14 |
+
"stored_dtype": [
|
| 15 |
+
"F32"
|
| 16 |
+
]
|
| 17 |
+
},
|
| 18 |
+
"checkpoint_selection": {
|
| 19 |
+
"best_epoch": 7,
|
| 20 |
+
"orchestration_seed": 20260515,
|
| 21 |
+
"criterion": "development covered-only top-1 accuracy"
|
| 22 |
+
},
|
| 23 |
+
"training_pair_file_audit": {
|
| 24 |
+
"sha256": "0b0965273203a5285ce6bcc2638095306a77f6171063e455fa47aebc37836eda",
|
| 25 |
+
"pairs": 38829,
|
| 26 |
+
"positive": 10385,
|
| 27 |
+
"negative": 28444,
|
| 28 |
+
"distinct_sentence_strings": 1604,
|
| 29 |
+
"empty_trailing_target_markers": 38727,
|
| 30 |
+
"nonempty_marked_spans": 102,
|
| 31 |
+
"historical_input_identity_verified": false,
|
| 32 |
+
"scope_note": "Counts describe the retained JSONL inspected during release preparation. Saved checkpoint cards also show empty markers. Historical byte identity and the effect on reported scores were not established by this file inspection."
|
| 33 |
+
},
|
| 34 |
+
"reported_round2_result": {
|
| 35 |
+
"split": "final_round2_matched",
|
| 36 |
+
"group": "total",
|
| 37 |
+
"model": "mling",
|
| 38 |
+
"model_name": "intfloat/multilingual-e5-large",
|
| 39 |
+
"mode": "trained",
|
| 40 |
+
"total_examples": 1921,
|
| 41 |
+
"covered_examples": 1894,
|
| 42 |
+
"coverage": 0.9859448204060385,
|
| 43 |
+
"correct_top1": 1394,
|
| 44 |
+
"incorrect_top1": 500,
|
| 45 |
+
"accuracy_covered": 0.7360084477296727,
|
| 46 |
+
"accuracy_covered_ci_low": 0.7156935322507435,
|
| 47 |
+
"accuracy_covered_ci_high": 0.7553679443783557,
|
| 48 |
+
"accuracy_covered_ci_95": "71.6-75.5",
|
| 49 |
+
"accuracy_strict": 0.7256637168141593,
|
| 50 |
+
"accuracy_strict_ci_low": 0.7052758505188592,
|
| 51 |
+
"accuracy_strict_ci_high": 0.7451508565883282,
|
| 52 |
+
"accuracy_strict_ci_95": "70.5-74.5",
|
| 53 |
+
"top3_accuracy": 0.9403379091869061,
|
| 54 |
+
"mrr": 0.8390760601887838
|
| 55 |
+
},
|
| 56 |
+
"reported_round2_checkpoint_identity_verified": false,
|
| 57 |
+
"reported_round2_protocol": "Gold sense appended if absent; one-candidate targets assigned without encoder; uncovered targets counted wrong in strict accuracy.",
|
| 58 |
+
"companion_code": "https://github.com/sasa5linkar/serbian-wsd-distillation/tree/v0.1.0",
|
| 59 |
+
"historical_code_identity_verified": false,
|
| 60 |
+
"source_model_weights_modified": false,
|
| 61 |
+
"dissertation": {
|
| 62 |
+
"author": "Saša Z. Petalinkar",
|
| 63 |
+
"author_orcid": "https://orcid.org/0009-0007-9664-3594",
|
| 64 |
+
"title": "Машинско учење и велики језички модели у развоју семантичких мрежа и њиховој примени на аутоматско разумевање текста",
|
| 65 |
+
"title_english": "Machine Learning and Large Language Models in the Development of Semantic Networks and Their Application in Automatic Text Understanding",
|
| 66 |
+
"institution": "University of Belgrade",
|
| 67 |
+
"year": 2026,
|
| 68 |
+
"document_type": "doctoral dissertation manuscript",
|
| 69 |
+
"language": "Serbian",
|
| 70 |
+
"method_section": "3.4",
|
| 71 |
+
"method_section_title": "Разрешење значења речи – дестилација",
|
| 72 |
+
"results_section": "5.8",
|
| 73 |
+
"results_section_title": "Резултати дестилације модела за разрешење значења речи",
|
| 74 |
+
"results_table": "5-16",
|
| 75 |
+
"model_mapping_table": "5-10",
|
| 76 |
+
"public_url": null,
|
| 77 |
+
"doi": null
|
| 78 |
+
},
|
| 79 |
+
"reported_round2_result_source": {
|
| 80 |
+
"type": "doctoral dissertation manuscript and retained experiment summary",
|
| 81 |
+
"dissertation_section": "5.8",
|
| 82 |
+
"dissertation_table": "5-16",
|
| 83 |
+
"evaluation_rerun_for_hub_release": false,
|
| 84 |
+
"association_evidence": "Selected epochs and development scores agree between saved training records and experiment handoff; reported final counts agree with the dissertation."
|
| 85 |
+
}
|
| 86 |
+
}
|