Upload folder using huggingface_hub
Browse files- README.md +64 -0
- config.json +1 -1
README.md
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
model_name: M2V_base_multilingual
|
3 |
+
base_model: sentence-transformers/LaBSE
|
4 |
+
language: ['multilingual', 'af', 'sq', 'am', 'ar', 'hy', 'as', 'az', 'eu', 'be', 'bn', 'bs', 'bg', 'my', 'ca', 'ceb', 'zh', 'co', 'hr', 'cs', 'da', 'nl', 'en', 'eo', 'et', 'fi', 'fr', 'fy', 'gl', 'ka', 'de', 'el', 'gu', 'ht', 'ha', 'haw', 'he', 'hi', 'hmn', 'hu', 'is', 'ig', 'id', 'ga', 'it', 'ja', 'jv', 'kn', 'kk', 'km', 'rw', 'ko', 'ku', 'ky', 'lo', 'la', 'lv', 'lt', 'lb', 'mk', 'mg', 'ms', 'ml', 'mt', 'mi', 'mr', 'mn', 'ne', 'no', 'ny', 'or', 'fa', 'pl', 'pt', 'pa', 'ro', 'ru', 'sm', 'gd', 'sr', 'st', 'sn', 'si', 'sk', 'sl', 'so', 'es', 'su', 'sw', 'sv', 'tl', 'tg', 'ta', 'tt', 'te', 'th', 'bo', 'tr', 'tk', 'ug', 'uk', 'ur', 'uz', 'vi', 'cy', 'wo', 'xh', 'yi', 'yo', 'zu']
|
5 |
+
library_name: 'model2vec'
|
6 |
+
license: mit
|
7 |
+
tags: [embeddings, sentence-transformers, static-embeddings]
|
8 |
+
---
|
9 |
+
|
10 |
+
# M2V_base_multilingual Model Card
|
11 |
+
|
12 |
+
Model2Vec distills a Sentence Transformer into a small, static model.
|
13 |
+
This model is ideal for applications requiring fast, lightweight embeddings.
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
## Installation
|
18 |
+
|
19 |
+
Install model2vec using pip:
|
20 |
+
```
|
21 |
+
pip install model2vec
|
22 |
+
```
|
23 |
+
|
24 |
+
## Usage
|
25 |
+
A StaticModel can be loaded using the `from_pretrained` method:
|
26 |
+
```python
|
27 |
+
from model2vec import StaticModel
|
28 |
+
model = StaticModel.from_pretrained("minishlab/M2V_base_output")
|
29 |
+
embeddings = model.encode(["Example sentence"])
|
30 |
+
```
|
31 |
+
|
32 |
+
Alternatively, you can distill your own model using the `distill` method:
|
33 |
+
```python
|
34 |
+
from model2vec.distill import distill
|
35 |
+
|
36 |
+
# Choose a Sentence Transformer model
|
37 |
+
model_name = "BAAI/bge-base-en-v1.5"
|
38 |
+
|
39 |
+
# Distill the model
|
40 |
+
m2v_model = distill(model_name=model_name, pca_dims=256)
|
41 |
+
|
42 |
+
# Save the model
|
43 |
+
m2v_model.save_pretrained("m2v_model")
|
44 |
+
```
|
45 |
+
|
46 |
+
## How it works
|
47 |
+
|
48 |
+
Model2vec creates a small, fast, and powerful model that outperforms other static embedding models by a large margin on all tasks we could find, while being much faster to create than traditional static embedding models such as GloVe. Best of all, you don't need any data to distill a model using Model2Vec.
|
49 |
+
|
50 |
+
It works by passing a vocabulary through a sentence transformer model, then reducing the dimensionality of the resulting embeddings using PCA, and finally weighting the embeddings using zipf weighting. During inference, we simply take the mean of all token embeddings occurring in a sentence.
|
51 |
+
|
52 |
+
## Citation
|
53 |
+
|
54 |
+
Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.
|
55 |
+
|
56 |
+
## Additional Resources
|
57 |
+
|
58 |
+
- [Model2Vec Repo](https://github.com/MinishLab/model2vec)
|
59 |
+
- [Model2Vec Results](https://github.com/MinishLab/model2vec?tab=readme-ov-file#results)
|
60 |
+
- [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)
|
61 |
+
|
62 |
+
## Model Authors
|
63 |
+
|
64 |
+
Model2Vec was developed by the [Minish Lab](https://github.com/MinishLab) team consisting of Stephan Tulkens and Thomas van Dongen.
|
config.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"tokenizer_name": "sentence-transformers/LaBSE", "apply_pca": 256, "apply_zipf": true}
|
|
|
1 |
+
{"tokenizer_name": "sentence-transformers/LaBSE", "apply_pca": 256, "apply_zipf": true, "normalize": false}
|