Feature Extraction
sentence-transformers
Safetensors
qwen3
sentence-similarity
retrieval
pruned-model
text-embeddings-inference
Instructions to use ukung/semantic-lite with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ukung/semantic-lite with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ukung/semantic-lite") 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
Update README: concise + multilingual support
Browse files
README.md
CHANGED
|
@@ -1,7 +1,28 @@
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
-
-
|
| 4 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
license: apache-2.0
|
| 6 |
library_name: sentence-transformers
|
| 7 |
tags:
|
|
@@ -10,55 +31,51 @@ tags:
|
|
| 10 |
- sentence-similarity
|
| 11 |
- retrieval
|
| 12 |
- embedding
|
|
|
|
| 13 |
pipeline_tag: sentence-similarity
|
| 14 |
---
|
| 15 |
|
| 16 |
# semantic-lite
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
##
|
| 23 |
|
| 24 |
```python
|
| 25 |
from sentence_transformers import SentenceTransformer
|
| 26 |
|
| 27 |
model = SentenceTransformer("ukung/semantic-lite")
|
| 28 |
-
|
| 29 |
-
# Encode teks (prompt otomatis diterapkan)
|
| 30 |
-
embeddings = model.encode([
|
| 31 |
-
"Cara mengoptimalkan query vector similarity",
|
| 32 |
-
"Panduan deployment embedding server",
|
| 33 |
-
])
|
| 34 |
print(embeddings.shape) # (2, 1024)
|
| 35 |
```
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
| Params | 250M (dari 596M) |
|
| 43 |
-
| Dimensi embedding | 1024 |
|
| 44 |
-
| Layer | 6 (pruned dari 28) |
|
| 45 |
-
| Max sequence | 512 token |
|
| 46 |
-
| Ukuran | ~500 MB (fp16) |
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
-
##
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
|
| 61 |
|---|---|---|
|
| 62 |
| nDCG@5 | **0.875** | 0.812 |
|
| 63 |
-
| Recall@5 |
|
| 64 |
| MRR | **0.891** | 0.807 |
|
|
|
|
| 1 |
---
|
| 2 |
language:
|
| 3 |
+
- multilingual
|
| 4 |
- en
|
| 5 |
+
- id
|
| 6 |
+
- zh
|
| 7 |
+
- ja
|
| 8 |
+
- ko
|
| 9 |
+
- es
|
| 10 |
+
- fr
|
| 11 |
+
- de
|
| 12 |
+
- it
|
| 13 |
+
- pt
|
| 14 |
+
- ru
|
| 15 |
+
- ar
|
| 16 |
+
- hi
|
| 17 |
+
- th
|
| 18 |
+
- vi
|
| 19 |
+
- tr
|
| 20 |
+
- nl
|
| 21 |
+
- pl
|
| 22 |
+
- sv
|
| 23 |
+
- he
|
| 24 |
+
- fa
|
| 25 |
+
- uk
|
| 26 |
license: apache-2.0
|
| 27 |
library_name: sentence-transformers
|
| 28 |
tags:
|
|
|
|
| 31 |
- sentence-similarity
|
| 32 |
- retrieval
|
| 33 |
- embedding
|
| 34 |
+
- multilingual
|
| 35 |
pipeline_tag: sentence-similarity
|
| 36 |
---
|
| 37 |
|
| 38 |
# semantic-lite
|
| 39 |
|
| 40 |
+
Lightweight multilingual embedding model for **retrieval** and **semantic similarity**.
|
| 41 |
|
| 42 |
+
Built from Qwen3-0.6B via **layer pruning** (28 → 6 layers): 2.4× smaller, same retrieval quality.
|
| 43 |
|
| 44 |
+
## Usage
|
| 45 |
|
| 46 |
```python
|
| 47 |
from sentence_transformers import SentenceTransformer
|
| 48 |
|
| 49 |
model = SentenceTransformer("ukung/semantic-lite")
|
| 50 |
+
embeddings = model.encode(["Hello world", "Halo dunia"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
print(embeddings.shape) # (2, 1024)
|
| 52 |
```
|
| 53 |
|
| 54 |
+
That is all. Prompting and pooling are handled automatically.
|
| 55 |
|
| 56 |
+
## Multilingual
|
| 57 |
+
|
| 58 |
+
Inherits Qwen3's **100+ language** coverage. Cross-lingual retrieval works out of the box — semantically equivalent sentences land close together regardless of language.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
+
Mean cosine similarity to the English reference across 22 languages: **0.786** (21/22 above 0.6).
|
| 61 |
|
| 62 |
+
## Specs
|
| 63 |
|
| 64 |
+
| Property | Value |
|
| 65 |
+
|---|---|
|
| 66 |
+
| Base | Qwen3-0.6B |
|
| 67 |
+
| Params | 250M (from 596M) |
|
| 68 |
+
| Embedding dim | 1024 |
|
| 69 |
+
| Layers | 6 (pruned from 28) |
|
| 70 |
+
| Max sequence | 512 tokens |
|
| 71 |
+
| Size | ~500 MB (fp16) |
|
| 72 |
|
| 73 |
+
## Evaluation
|
| 74 |
|
| 75 |
+
Internal retrieval set (20 docs, 8 queries):
|
| 76 |
|
| 77 |
+
| Metric | semantic-lite | all-MiniLM-L6-v2 |
|
| 78 |
|---|---|---|
|
| 79 |
| nDCG@5 | **0.875** | 0.812 |
|
| 80 |
+
| Recall@5 | 0.875 | 0.875 |
|
| 81 |
| MRR | **0.891** | 0.807 |
|