{ "cells": [ { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2024-05-31T18:13:23.806907Z", "start_time": "2024-05-31T18:13:23.797078Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The autoreload extension is already loaded. To reload it, use:\n", " %reload_ext autoreload\n" ] } ], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2024-05-31T18:14:31.147674Z", "start_time": "2024-05-31T18:14:31.134015Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "\n", "from fastembed import (\n", " SparseTextEmbedding,\n", " TextEmbedding,\n", " LateInteractionTextEmbedding,\n", " ImageEmbedding,\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Supported Text Embedding Models" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2024-05-31T18:13:25.863008Z", "start_time": "2024-05-31T18:13:25.837795Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
modeldimdescriptionsize_in_GB
0BAAI/bge-small-en-v1.5384Fast and Default English model0.067
1BAAI/bge-small-zh-v1.5512Fast and recommended Chinese model0.090
2snowflake/snowflake-arctic-embed-xs384Based on all-MiniLM-L6-v2 model with only 22m ...0.090
3sentence-transformers/all-MiniLM-L6-v2384Sentence Transformer model, MiniLM-L6-v20.090
4jinaai/jina-embeddings-v2-small-en512English embedding model supporting 8192 sequen...0.120
5BAAI/bge-small-en384Fast English model0.130
6snowflake/snowflake-arctic-embed-s384Based on infloat/e5-small-unsupervised, does n...0.130
7nomic-ai/nomic-embed-text-v1.5-Q768Quantized 8192 context length english model0.130
8BAAI/bge-base-en-v1.5768Base English model, v1.50.210
9sentence-transformers/paraphrase-multilingual-...384Sentence Transformer model, paraphrase-multili...0.220
10Qdrant/clip-ViT-B-32-text512CLIP text encoder0.250
11jinaai/jina-embeddings-v2-base-de768German embedding model supporting 8192 sequenc...0.320
12BAAI/bge-base-en768Base English model0.420
13snowflake/snowflake-arctic-embed-m768Based on intfloat/e5-base-unsupervised model, ...0.430
14nomic-ai/nomic-embed-text-v1.57688192 context length english model0.520
15jinaai/jina-embeddings-v2-base-en768English embedding model supporting 8192 sequen...0.520
16nomic-ai/nomic-embed-text-v17688192 context length english model0.520
17snowflake/snowflake-arctic-embed-m-long768Based on nomic-ai/nomic-embed-text-v1-unsuperv...0.540
18mixedbread-ai/mxbai-embed-large-v11024MixedBread Base sentence embedding model, does...0.640
19jinaai/jina-embeddings-v2-base-code768Source code embedding model supporting 8192 se...0.640
20sentence-transformers/paraphrase-multilingual-...768Sentence-transformers model for tasks like clu...1.000
21snowflake/snowflake-arctic-embed-l1024Based on intfloat/e5-large-unsupervised, large...1.020
22thenlper/gte-large1024Large general text embeddings model1.200
23BAAI/bge-large-en-v1.51024Large English model, v1.51.200
24intfloat/multilingual-e5-large1024Multilingual model, e5-large. Recommend using ...2.240
\n", "
" ], "text/plain": [ " model dim \\\n", "0 BAAI/bge-small-en-v1.5 384 \n", "1 BAAI/bge-small-zh-v1.5 512 \n", "2 snowflake/snowflake-arctic-embed-xs 384 \n", "3 sentence-transformers/all-MiniLM-L6-v2 384 \n", "4 jinaai/jina-embeddings-v2-small-en 512 \n", "5 BAAI/bge-small-en 384 \n", "6 snowflake/snowflake-arctic-embed-s 384 \n", "7 nomic-ai/nomic-embed-text-v1.5-Q 768 \n", "8 BAAI/bge-base-en-v1.5 768 \n", "9 sentence-transformers/paraphrase-multilingual-... 384 \n", "10 Qdrant/clip-ViT-B-32-text 512 \n", "11 jinaai/jina-embeddings-v2-base-de 768 \n", "12 BAAI/bge-base-en 768 \n", "13 snowflake/snowflake-arctic-embed-m 768 \n", "14 nomic-ai/nomic-embed-text-v1.5 768 \n", "15 jinaai/jina-embeddings-v2-base-en 768 \n", "16 nomic-ai/nomic-embed-text-v1 768 \n", "17 snowflake/snowflake-arctic-embed-m-long 768 \n", "18 mixedbread-ai/mxbai-embed-large-v1 1024 \n", "19 jinaai/jina-embeddings-v2-base-code 768 \n", "20 sentence-transformers/paraphrase-multilingual-... 768 \n", "21 snowflake/snowflake-arctic-embed-l 1024 \n", "22 thenlper/gte-large 1024 \n", "23 BAAI/bge-large-en-v1.5 1024 \n", "24 intfloat/multilingual-e5-large 1024 \n", "\n", " description size_in_GB \n", "0 Fast and Default English model 0.067 \n", "1 Fast and recommended Chinese model 0.090 \n", "2 Based on all-MiniLM-L6-v2 model with only 22m ... 0.090 \n", "3 Sentence Transformer model, MiniLM-L6-v2 0.090 \n", "4 English embedding model supporting 8192 sequen... 0.120 \n", "5 Fast English model 0.130 \n", "6 Based on infloat/e5-small-unsupervised, does n... 0.130 \n", "7 Quantized 8192 context length english model 0.130 \n", "8 Base English model, v1.5 0.210 \n", "9 Sentence Transformer model, paraphrase-multili... 0.220 \n", "10 CLIP text encoder 0.250 \n", "11 German embedding model supporting 8192 sequenc... 0.320 \n", "12 Base English model 0.420 \n", "13 Based on intfloat/e5-base-unsupervised model, ... 0.430 \n", "14 8192 context length english model 0.520 \n", "15 English embedding model supporting 8192 sequen... 0.520 \n", "16 8192 context length english model 0.520 \n", "17 Based on nomic-ai/nomic-embed-text-v1-unsuperv... 0.540 \n", "18 MixedBread Base sentence embedding model, does... 0.640 \n", "19 Source code embedding model supporting 8192 se... 0.640 \n", "20 Sentence-transformers model for tasks like clu... 1.000 \n", "21 Based on intfloat/e5-large-unsupervised, large... 1.020 \n", "22 Large general text embeddings model 1.200 \n", "23 Large English model, v1.5 1.200 \n", "24 Multilingual model, e5-large. Recommend using ... 2.240 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "supported_models = (\n", " pd.DataFrame(TextEmbedding.list_supported_models())\n", " .sort_values(\"size_in_GB\")\n", " .drop(columns=[\"sources\", \"model_file\", \"additional_files\"])\n", " .reset_index(drop=True)\n", ")\n", "supported_models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Supported Sparse Text Embedding Models" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2024-05-31T18:13:27.124747Z", "start_time": "2024-05-31T18:13:27.096212Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
modelvocab_sizedescriptionsize_in_GBrequires_idf
0Qdrant/bm25NaNBM25 as sparse embeddings meant to be used wit...0.010True
1Qdrant/bm42-all-minilm-l6-v2-attentions30522.0Light sparse embedding model, which assigns an...0.090True
2prithvida/Splade_PP_en_v130522.0Misspelled version of the model. Retained for ...0.532NaN
3prithivida/Splade_PP_en_v130522.0Independent Implementation of SPLADE++ Model f...0.532NaN
\n", "
" ], "text/plain": [ " model vocab_size \\\n", "0 Qdrant/bm25 NaN \n", "1 Qdrant/bm42-all-minilm-l6-v2-attentions 30522.0 \n", "2 prithvida/Splade_PP_en_v1 30522.0 \n", "3 prithivida/Splade_PP_en_v1 30522.0 \n", "\n", " description size_in_GB requires_idf \n", "0 BM25 as sparse embeddings meant to be used wit... 0.010 True \n", "1 Light sparse embedding model, which assigns an... 0.090 True \n", "2 Misspelled version of the model. Retained for ... 0.532 NaN \n", "3 Independent Implementation of SPLADE++ Model f... 0.532 NaN " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(\n", " pd.DataFrame(SparseTextEmbedding.list_supported_models())\n", " .sort_values(\"size_in_GB\")\n", " .drop(columns=[\"sources\", \"model_file\", \"additional_files\"])\n", " .reset_index(drop=True)\n", ")" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "## Supported Late Interaction Text Embedding Models" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2024-05-31T18:14:34.370252Z", "start_time": "2024-05-31T18:14:34.354270Z" }, "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
modeldimdescriptionsize_in_GB
0colbert-ir/colbertv2.0128Late interaction model0.44
\n", "
" ], "text/plain": [ " model dim description size_in_GB\n", "0 colbert-ir/colbertv2.0 128 Late interaction model 0.44" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(\n", " pd.DataFrame(LateInteractionTextEmbedding.list_supported_models())\n", " .sort_values(\"size_in_GB\")\n", " .drop(columns=[\"sources\", \"model_file\"])\n", " .reset_index(drop=True)\n", ")" ] }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "## Supported Image Embedding Models" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2024-05-31T18:14:42.501881Z", "start_time": "2024-05-31T18:14:42.484726Z" }, "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
modeldimdescriptionsize_in_GB
0Qdrant/resnet50-onnx2048ResNet-50 from `Deep Residual Learning for Ima...0.10
1Qdrant/clip-ViT-B-32-vision512CLIP vision encoder based on ViT-B/320.34
2Qdrant/Unicom-ViT-B-32512Unicom Unicom-ViT-B-32 from open-metric-learning0.48
3Qdrant/Unicom-ViT-B-16768Unicom Unicom-ViT-B-16 from open-metric-learning0.82
\n", "
" ], "text/plain": [ " model dim \\\n", "0 Qdrant/resnet50-onnx 2048 \n", "1 Qdrant/clip-ViT-B-32-vision 512 \n", "2 Qdrant/Unicom-ViT-B-32 512 \n", "3 Qdrant/Unicom-ViT-B-16 768 \n", "\n", " description size_in_GB \n", "0 ResNet-50 from `Deep Residual Learning for Ima... 0.10 \n", "1 CLIP vision encoder based on ViT-B/32 0.34 \n", "2 Unicom Unicom-ViT-B-32 from open-metric-learning 0.48 \n", "3 Unicom Unicom-ViT-B-16 from open-metric-learning 0.82 " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(\n", " pd.DataFrame(ImageEmbedding.list_supported_models()).sort_values(\"size_in_GB\")\n", " .drop(columns=[\"sources\", \"model_file\"])\n", " .reset_index(drop=True)\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.8.18 ('base')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.8" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "c4a27af61e455bc18dcf16f5867a2ff0402fa12b01dd0f6ce3a79ae73ad15e91" } } }, "nbformat": 4, "nbformat_minor": 2 }