Sentence Similarity
sentence-transformers
Safetensors
Kannada
xlm-roberta
trimmed
text-embeddings-inference
Instructions to use alphaedge-ai/bge-m3-kan-16384 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use alphaedge-ai/bge-m3-kan-16384 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("alphaedge-ai/bge-m3-kan-16384") 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 model card for Kannada
Browse files
README.md
CHANGED
|
@@ -1,69 +1,74 @@
|
|
| 1 |
-
---
|
| 2 |
-
pipeline_tag: sentence-similarity
|
| 3 |
-
language: kan
|
| 4 |
-
license: mit
|
| 5 |
-
tags:
|
| 6 |
-
- trimmed
|
| 7 |
-
library_name: sentence-transformers
|
| 8 |
-
base_model: BAAI/bge-m3
|
| 9 |
-
base_model_relation: quantized
|
| 10 |
-
datasets:
|
| 11 |
-
-
|
| 12 |
-
---
|
| 13 |
-
|
| 14 |
-
# bge-m3-kan-16384
|
| 15 |
-
|
| 16 |
-
This model
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: sentence-similarity
|
| 3 |
+
language: kan
|
| 4 |
+
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- trimmed
|
| 7 |
+
library_name: sentence-transformers
|
| 8 |
+
base_model: BAAI/bge-m3
|
| 9 |
+
base_model_relation: quantized
|
| 10 |
+
datasets:
|
| 11 |
+
- lbourdois/fineweb-2-trimming
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# bge-m3-kan-16384
|
| 15 |
+
This model is a **42.14% smaller** version of [BAAI/bge-m3](https://huggingface.co/BAAI/bge-m3) optimized for Kannada language via vocabulary size reduction using the [trimming](https://huggingface.co/blog/lbourdois/introduction-to-trimming) method.
|
| 16 |
+
This trimmed model should perform similarly to the original model with only 16,384 tokens and a much smaller memory footprint. However, it may not perform well for other languages as tokens not commonly used in the selected languages were removed from the vocabulary.
|
| 17 |
+
|
| 18 |
+
## Model Statistics
|
| 19 |
+
|
| 20 |
+
| Metric | Original | Trimmed | Reduction |
|
| 21 |
+
|--------|----------|---------|-----------|
|
| 22 |
+
| **Vocabulary size** | 250,002 tokens | 16,384 tokens | **93.45%** |
|
| 23 |
+
| **Model size** | 567,754,752 params | 328,529,920 params | **42.14%** |
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
|
| 27 |
+
## Mining Dataset Statistics
|
| 28 |
+
- **Number of texts used for mining**: 200,000 texts
|
| 29 |
+
- **Dataset**: [lbourdois/fineweb-2-trimming](https://huggingface.co/datasets/lbourdois/fineweb-2-trimming)
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from sentence_transformers import SentenceTransformer
|
| 35 |
+
# Download from the 🤗 Hub
|
| 36 |
+
model = SentenceTransformer("alphaedge-ai/bge-m3-kan-16384")
|
| 37 |
+
# Run inference with queries and documents
|
| 38 |
+
query = "My query in Kannada"
|
| 39 |
+
documents = [
|
| 40 |
+
"Chunk in Kannada",
|
| 41 |
+
"Chunk in Kannada",
|
| 42 |
+
"Chunk in Kannada",
|
| 43 |
+
]
|
| 44 |
+
query_embeddings = model.encode_query(query)
|
| 45 |
+
document_embeddings = model.encode_document(documents)
|
| 46 |
+
print(query_embeddings.shape, document_embeddings.shape)
|
| 47 |
+
# Compute similarities to determine a ranking
|
| 48 |
+
similarities = model.similarity(query_embeddings, document_embeddings)
|
| 49 |
+
print(similarities)
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Citations
|
| 53 |
+
|
| 54 |
+
#### BGE-M3
|
| 55 |
+
```
|
| 56 |
+
@misc{bge-m3,
|
| 57 |
+
title={BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation},
|
| 58 |
+
author={Jianlv Chen and Shitao Xiao and Peitian Zhang and Kun Luo and Defu Lian and Zheng Liu},
|
| 59 |
+
year={2024},
|
| 60 |
+
eprint={2402.03216},
|
| 61 |
+
archivePrefix={arXiv},
|
| 62 |
+
primaryClass={cs.CL}
|
| 63 |
+
}
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
#### Trimming blog post
|
| 67 |
+
```
|
| 68 |
+
@misc{hf_blogpost_trimming,
|
| 69 |
+
title={Introduction to Trimming},
|
| 70 |
+
author={Loïck BOURDOIS and Tom AARSEN and Bram VANROY and Christopher AKIKI and Woojun JUNG and Manuel ROMERO and Prithiv SAKTHI},
|
| 71 |
+
year={2026},
|
| 72 |
+
url={https://huggingface.co/blog/lbourdois/introduction-to-trimming},
|
| 73 |
+
}
|
| 74 |
+
```
|