model2vec 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,176 @@
1
+ local/*
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ build/
14
+ develop-eggs/
15
+ dist/
16
+ downloads/
17
+ eggs/
18
+ .eggs/
19
+ lib/
20
+ lib64/
21
+ parts/
22
+ sdist/
23
+ var/
24
+ wheels/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ .pybuilder/
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ # For a library or package, you might want to ignore these files since the code is
89
+ # intended to run in multiple environments; otherwise, check them in:
90
+ # .python-version
91
+
92
+ # pipenv
93
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
95
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
96
+ # install all needed dependencies.
97
+ #Pipfile.lock
98
+
99
+ # poetry
100
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
101
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
102
+ # commonly ignored for libraries.
103
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
104
+ #poetry.lock
105
+
106
+ # pdm
107
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
108
+ #pdm.lock
109
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
110
+ # in version control.
111
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
112
+ .pdm.toml
113
+ .pdm-python
114
+ .pdm-build/
115
+
116
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117
+ __pypackages__/
118
+
119
+ # Celery stuff
120
+ celerybeat-schedule
121
+ celerybeat.pid
122
+
123
+ # SageMath parsed files
124
+ *.sage.py
125
+
126
+ # Environments
127
+ .env
128
+ .venv
129
+ env/
130
+ venv/
131
+ ENV/
132
+ env.bak/
133
+ venv.bak/
134
+
135
+ # Spyder project settings
136
+ .spyderproject
137
+ .spyproject
138
+
139
+ # Rope project settings
140
+ .ropeproject
141
+
142
+ # mkdocs documentation
143
+ /site
144
+
145
+ # mypy
146
+ .mypy_cache/
147
+ .dmypy.json
148
+ dmypy.json
149
+
150
+ # Pyre type checker
151
+ .pyre/
152
+
153
+ # pytype static type analyzer
154
+ .pytype/
155
+
156
+ # Cython debug symbols
157
+ cython_debug/
158
+
159
+ # PyCharm
160
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
163
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
+ #.idea/
165
+ *.npy
166
+ *.torch
167
+ .venv
168
+ .DS_Store
169
+ models
170
+ checkpoints/*
171
+ features/*
172
+ model2vec_models
173
+ results/*
174
+ counts/*
175
+ results_old/*
176
+ lightning_logs/*
@@ -0,0 +1,34 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v4.4.0
6
+ hooks:
7
+ - id: check-ast
8
+ description: Simply check whether files parse as valid python.
9
+ - id: trailing-whitespace
10
+ description: Trims trailing whitespace
11
+ - id: end-of-file-fixer
12
+ description: Makes sure files end in a newline and only a newline.
13
+ - id: check-added-large-files
14
+ args: ['--maxkb=5000']
15
+ description: Prevent giant files from being committed.
16
+ - id: check-case-conflict
17
+ description: Check for files with names that would conflict on case-insensitive filesystems like MacOS/Windows.
18
+ - repo: https://github.com/jsh9/pydoclint
19
+ rev: 0.5.3
20
+ hooks:
21
+ - id: pydoclint
22
+ - repo: https://github.com/astral-sh/ruff-pre-commit
23
+ rev: v0.4.10
24
+ hooks:
25
+ - id: ruff
26
+ args: [ --fix ]
27
+ - id: ruff-format
28
+ - repo: local
29
+ hooks:
30
+ - id: mypy
31
+ name: mypy
32
+ entry: mypy
33
+ language: python
34
+ types: [python]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Thomas van Dongen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,18 @@
1
+ clean:
2
+
3
+
4
+ venv:
5
+ uv venv
6
+
7
+ install:
8
+ uv sync --all-extras
9
+ uv run pre-commit install
10
+
11
+ install-base:
12
+ uv sync --extra dev
13
+
14
+ fix:
15
+ uv run pre-commit run --all-files
16
+
17
+ test:
18
+ uv run pytest --cov=model2vec --cov-report=term-missing
@@ -0,0 +1,307 @@
1
+ Metadata-Version: 2.1
2
+ Name: model2vec
3
+ Version: 0.1.0
4
+ Summary: Distill a Small Fast Model from any Sentence Transformer
5
+ Author-email: Stéphan Tulkens <stephantul@gmail.com>, Thomas van Dongen <thomas123@live.nl>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024 Thomas van Dongen
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/MinishLab
29
+ Project-URL: Bug Reports, https://github.com/MinishLab/model2vec/issues
30
+ Project-URL: Source, https://github.com/MinishLab/model2vec
31
+ Classifier: Development Status :: 4 - Beta
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: Intended Audience :: Science/Research
34
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
35
+ Classifier: Topic :: Software Development :: Libraries
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Programming Language :: Python :: 3 :: Only
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Natural Language :: English
42
+ Requires-Python: >=3.10
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: click
46
+ Requires-Dist: numpy
47
+ Requires-Dist: rich
48
+ Requires-Dist: tqdm
49
+ Requires-Dist: typer
50
+ Requires-Dist: transformers
51
+ Requires-Dist: torch
52
+ Requires-Dist: sentence_transformers
53
+ Requires-Dist: tokenizers
54
+ Requires-Dist: scikit-learn
55
+ Provides-Extra: dev
56
+ Requires-Dist: black; extra == "dev"
57
+ Requires-Dist: ipython; extra == "dev"
58
+ Requires-Dist: mypy; extra == "dev"
59
+ Requires-Dist: pre-commit; extra == "dev"
60
+ Requires-Dist: pytest; extra == "dev"
61
+ Requires-Dist: pytest-coverage; extra == "dev"
62
+ Requires-Dist: ruff; extra == "dev"
63
+
64
+ # Model2Vec: Distill a Small Fast Model from any Sentence Transformer
65
+
66
+ **Model2Vec** is a method to distill a small, fast model from any Sentence Transformer model.
67
+
68
+ ## Table of Contents
69
+ - [Main Features](#main-features)
70
+ - [Quickstart](#quickstart)
71
+ - [What is Model2Vec?](#what-is-model2vec)
72
+ - [Who is this for?](#who-is-this-for)
73
+ - [Usage](#usage)
74
+ - [Distilling a Model2Vec model](#distilling-a-model2vec-model)
75
+ - [Inferencing a Model2Vec model](#inferencing-a-model2vec-model)
76
+ - [Evaluating a Model2Vec model](#evaluating-a-model2vec-model)
77
+ - [Results](#results)
78
+ - [Citing](#citing)
79
+
80
+ ## Main Features
81
+ - **Small**: Model2Vec can reduce the size of a Sentence Transformer model by a factor of 15 *.
82
+ - **Fast distillation**: Model2Vec can distill a Sentence Transformer model in ~5 minutes on CPU *.
83
+ - **Fast inference**: Model2Vec creates static embeddings that are up to 500 times * faster than the original model.
84
+ - **State-of-the-art static embedding performance**: Model2Vec outperforms traditional static embeddings by a large margin on a number of benchmarks.
85
+ - **No data needed**: Distillation happens directly on a token leven, so no dataset is needed.
86
+ - **Simple to use**: Model2Vec provides an easy to use interface for distilling and inferencing Model2Vec models.
87
+ - **Bring your own model**: Model2Vec can be applied to any Sentence Transformer model.
88
+ - **Bring your own vocabulary**: Model2Vec can be applied to any vocabulary, allowing you to use your own domain-specific vocabulary.
89
+ - **Multi-lingual**: Model2Vec can easily be applied to any language.
90
+ - **Tightly integrated with HuggingFace hub**: Model2Vec models can be easily shared and loaded from the HuggingFace hub. Our models can be found [here](https://huggingface.co/minishlab).
91
+ - **Easy Evaluation**: Model2Vec comes with a set of evaluation tasks to measure the performance of the distilled model.
92
+
93
+ \* Based on the [bge-base-en-v1.5 model](https://huggingface.co/BAAI/bge-base-en-v1.5).
94
+
95
+
96
+ ## Quickstart
97
+
98
+ Install the package with:
99
+ ```bash
100
+ pip install model2vec
101
+ ```
102
+
103
+ The easiest way to get started with Model2Vec is to download one of our [flagship models from the HuggingFace hub](https://huggingface.co/minishlab). These models are pre-trained and ready to use. The following code snippet shows how to load a model and make embeddings:
104
+ ```python
105
+ from model2vec import StaticModel
106
+
107
+ # Load a model from the HuggingFace hub (in this case the M2V_base_output model)
108
+ model_name = "minishlab/M2V_base_output"
109
+ model = StaticModel.from_pretrained(model_name)
110
+
111
+ # Make embeddings
112
+ embeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everyone."])
113
+ ```
114
+
115
+ Alternatively, you can distill your own Model2Vec model from a Sentence Transformer model. The following code snippet shows how to distill a model:
116
+ ```python
117
+ from model2vec.distill import distill
118
+
119
+ # Choose a Sentence Transformer model
120
+ model_name = "BAAI/bge-base-en-v1.5"
121
+
122
+ # Distill the model
123
+ m2v_model = distill(model_name=model_name, pca_dims=256)
124
+
125
+ # Save the model
126
+ m2v_model.save_pretrained("m2v_model")
127
+ ```
128
+
129
+ ## What is Model2Vec?
130
+ Model2Vec is a simple and effective method to distill any sentence transformer into static embeddings. It works by inferencing a vocabulary with the specified Sentence Transformer model, reducing the dimensionality of the embeddings using PCA, weighting the embeddings using zipf weighting, and storing the embeddings in a static format.
131
+
132
+ This technique creates a small, fast, and powerful model that outperforms other static embedding models by a large margin on a a number of relevent tasks, while being much faster to create than traditional static embedding models such as GloVe, without need for a dataset.
133
+
134
+
135
+ ## Who is this for?
136
+ Model2Vec allows anyone to create their own static embeddings from any Sentence Transformer model in minutes. It can easily be applied to other languages by using a language-specific Sentence Transformer model and vocab. Similarly, it can be applied to specific domains by using a domain specific model, vocab, or both. This makes it an ideal tool for fast prototyping, research, and production use cases where speed and size are more important than performance.
137
+
138
+
139
+
140
+
141
+ ## Usage
142
+
143
+ ### Distilling a Model2Vec model
144
+
145
+ Distilling a model from the output embeddings of a Sentence Transformer model:
146
+ ```python
147
+ from model2vec.distill import distill
148
+
149
+ # Choose a Sentence Transformer model
150
+ model_name = "BAAI/bge-base-en-v1.5"
151
+
152
+ # Distill the model
153
+ m2v_model = distill(model_name=model_name, pca_dims=256)
154
+
155
+ # Save the model
156
+ m2v_model.save_pretrained("m2v_model")
157
+
158
+ ```
159
+
160
+ Distilling with a custom vocabulary:
161
+ ```python
162
+ from model2vec.distill import distill
163
+
164
+ # Load a vocabulary as a list of strings
165
+ vocabulary = ["word1", "word2", "word3"]
166
+ # Choose a Sentence Transformer model
167
+ model_name = "BAAI/bge-base-en-v1.5"
168
+
169
+ # Distill the model with the custom vocabulary
170
+ m2v_model = distill(model_name=model_name, vocabulary=vocabulary, pca_dims=256)
171
+
172
+ # Save the model
173
+ m2v_model.save_pretrained("m2v_model")
174
+ ```
175
+
176
+ Alternatively, the command line interface can be used to distill a model:
177
+ ```bash
178
+ python3 -m model2vec.distill --model-name BAAI/bge-base-en-v1.5 --vocabulary-path vocab.txt --device mps --save-path model2vec_model
179
+ ```
180
+
181
+ ### Inferencing a Model2Vec model
182
+ Inferencing with one of our flagship Model2Vec models:
183
+ ```python
184
+ from model2vec import StaticModel
185
+
186
+ # Load a model from the HuggingFace hub
187
+ model_name = "minishlab/M2V_base_output"
188
+ model = StaticModel.from_pretrained(model_name)
189
+
190
+ # Make embeddings
191
+ embeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everyone."])
192
+ ```
193
+
194
+
195
+ Inferencing with a saved Model2Vec model:
196
+ ```python
197
+ from model2vec import StaticModel
198
+
199
+ # Load a saved model
200
+ model_name = "m2v_model"
201
+ model = StaticModel.from_pretrained(model_name)
202
+
203
+ # Make embeddings
204
+ embeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everyone."])
205
+ ```
206
+
207
+ ### Evaluating a Model2Vec model
208
+
209
+ Model2Vec models can be evaluated using our [evaluation package](https://github.com/MinishLab/evaluation). To run this, first install the optionall evaluation package:
210
+ ```bash
211
+ pip install evaluation@git+https://github.com/MinishLab/evaluation@main
212
+ ```
213
+
214
+ Then, the following code snippet shows how to evaluate a Model2Vec model:
215
+ ```python
216
+ from model2vec import StaticModel
217
+
218
+ from evaluation import CustomMTEB, get_tasks, parse_mteb_results, make_leaderboard, summarize_results
219
+ from mteb import ModelMeta
220
+
221
+ # Get all available tasks
222
+ tasks = get_tasks()
223
+ # Define the CustomMTEB object with the specified tasks
224
+ evaluation = CustomMTEB(tasks=tasks)
225
+
226
+ # Load the model
227
+ model_name = "m2v_model"
228
+ model = StaticModel.from_pretrained(model_name)
229
+
230
+ # Optionally, add model metadata in MTEB format
231
+ model.mteb_model_meta = ModelMeta(
232
+ name=model_name, revision="no_revision_available", release_date=None, languages=None
233
+ )
234
+
235
+ # Run the evaluation
236
+ results = evaluation.run(model, eval_splits=["test"], output_folder=f"results/{model_name}")
237
+
238
+ # Parse the results and summarize them
239
+ parsed_results = parse_mteb_results(mteb_results=results, model_name=model_name)
240
+ task_scores = summarize_results(parsed_results)
241
+ # Print the results in a leaderboard format
242
+ print(make_leaderboard(task_scores))
243
+ ```
244
+
245
+ ## Results
246
+
247
+ ### Main Results
248
+
249
+ Model2Vec is evaluated on MTEB, as well as two additional tasks: PEARL (a phrase representation task) and WordSim (a word similarity task). The results are shown in the table below.
250
+
251
+
252
+
253
+
254
+ | Model | Avg (All) | Avg (MTEB) | Class | Clust | PairClass | Rank | Ret | STS | Sum | PEARL | WordSim |
255
+ |------------------|-------------|------------|-------|-------|-----------|-------|-------|-------|-------|-------|---------|
256
+ | all-MiniLM-L6-v2 | 56.08 | 56.09 | 62.62 | 41.94 | 82.37 | 58.04 | 41.95 | 78.90 | 30.81 | 60.83 | 49.91 |
257
+ | M2V_base_glove | 48.58 | 47.60 | 61.35 | 30.52 | 75.34 | 48.50 | 29.26 | 70.31 | 31.50 | 50.28 | 54.29 |
258
+ | M2V_base_output | 46.79 | 45.34 | 61.25 | 25.58 | 74.90 | 47.63 | 26.14 | 68.58 | 29.20 | 54.02 | 49.18 |
259
+ | GloVe_300d | 42.84 | 42.36 | 57.31 | 27.66 | 72.48 | 43.30 | 22.78 | 61.90 | 28.81 | 45.65 | 43.05 |
260
+ | WL256* | 48.88 | 49.36 | 58.98 | 33.34 | 74.00 | 52.03 | 33.12 | 73.34 | 29.05 | 48.81 | 45.16 |
261
+
262
+ <details>
263
+ <summary> Task Abbreviations </summary>
264
+
265
+ For readability, the MTEB task names are abbreviated as follows:
266
+ - Class: Classification
267
+ - Clust: Clustering
268
+ - PairClass: PairClassification
269
+ - Rank: Reranking
270
+ - Ret: Retrieval
271
+ - STS: Semantic Textual Similarity
272
+ - Sum: Summarization
273
+ </details>
274
+
275
+ \
276
+ \* WL256, introduced in the [WordLlama](https://github.com/dleemiller/WordLlama/tree/main) package is included for comparison due to its similarities to Model2Vec. However, we believe it is heavily overfit to the MTEB dataset since it is trained on datasets used in MTEB itself. This can be seen by the fact that the WL256 model performs much worse on the non-MTEB tasks (PEARL and WordSim) than our models. The results shown in the [Classification and Speed Benchmarks](#classification-and-speed-benchmarks) further support this.
277
+
278
+ ### Classification and Speed Benchmarks
279
+
280
+ In addition to the MTEB evaluation, Model2Vec is evaluated on a number of classification datasets. These are used as additional analysis to avoid overfitting to the MTEB dataset and to benchmark the speed of the model. The results are shown in the table below.
281
+
282
+ | model | Average | sst2 | imdb | trec | ag_news |
283
+ |:-----------------|----------:|---------:|-------:|---------:|----------:|
284
+ | bge-base-en-v1.5 | 90.00 | 91.54 | 91.88 | 85.16 | 91.45 |
285
+ | all-MiniLM-L6-v2 | 84.10 | 83.95 | 81.36 | 81.31 | 89.77 |
286
+ | M2V_base_output | 82.23 | 80.92 | 84.56 | 75.27 | 88.17 |
287
+ | M2V_base_glove | 80.76 | 83.07 | 85.24 | 66.12 | 88.61 |
288
+ | WL256 | 78.48 | 76.88 | 80.12 | 69.23 | 87.68 |
289
+ | GloVe_300d | 77.77 | 81.68 | 84.00 | 55.67 | 89.71 |
290
+
291
+ As can be seen, the Model2Vec models outperforms the GloVe and WL256 models on all classification tasks, and is competitive with the all-MiniLM-L6-v2 model while being much faster.
292
+
293
+ The scatterplot below shows the relationship between the number of sentences per second and the average classification score. The bubble sizes correspond to the number of parameters in the models (larger = more parameters), and the colors correspond to the sentences per second (greener = more sentences per second). This plot shows that the Model2Vec models are much faster than the other models, while still being competitive in terms of classification performance with the all-MiniLM-L6-v2 model.
294
+
295
+ ![Description](assets/images/sentences_per_second_vs_average_score.png)
296
+
297
+ ## Citing
298
+
299
+ If you use Model2Vec in your research, please cite the following:
300
+ ```bibtex
301
+ @software{minishlab2024word2vec,
302
+ authors = {Stephan Tulkens, Thomas van Dongen},
303
+ title = {Model2Vec: Turn any Sentence Transformer into a Small Fast Model},
304
+ year = {2024},
305
+ url = {https://github.com/MinishLab/model2vec},
306
+ }
307
+ ```