{ "cells": [ { "cell_type": "code", "metadata": { "ExecuteTime": { "end_time": "2024-11-13T09:01:03.324551Z", "start_time": "2024-11-13T09:01:03.234711Z" } }, "source": [ "%load_ext autoreload\n", "%autoreload 2" ], "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The autoreload extension is already loaded. To reload it, use:\n", " %reload_ext autoreload\n" ] } ], "execution_count": 10 }, { "cell_type": "code", "metadata": { "ExecuteTime": { "end_time": "2024-11-13T09:01:04.505772Z", "start_time": "2024-11-13T09:01:04.493296Z" } }, "source": [ "import pandas as pd\n", "\n", "from fastembed import (\n", " SparseTextEmbedding,\n", " TextEmbedding,\n", " LateInteractionTextEmbedding,\n", " ImageEmbedding,\n", ")\n", "from fastembed.rerank.cross_encoder import TextCrossEncoder" ], "outputs": [], "execution_count": 11 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Supported Text Embedding Models" ] }, { "cell_type": "code", "metadata": { "ExecuteTime": { "end_time": "2024-11-13T09:01:05.812271Z", "start_time": "2024-11-13T09:01:05.795846Z" } }, "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" ], "outputs": [ { "data": { "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 license size_in_GB \n", "0 Text embeddings, Unimodal (text), English, 512... mit 0.067 \n", "1 Text embeddings, Unimodal (text), Chinese, 512... mit 0.090 \n", "2 Text embeddings, Unimodal (text), English, 512... apache-2.0 0.090 \n", "3 Text embeddings, Unimodal (text), English, 256... apache-2.0 0.090 \n", "4 Text embeddings, Unimodal (text), English, 819... apache-2.0 0.120 \n", "5 Text embeddings, Unimodal (text), English, 512... mit 0.130 \n", "6 Text embeddings, Unimodal (text), English, 512... apache-2.0 0.130 \n", "7 Text embeddings, Multimodal (text, image), Eng... apache-2.0 0.130 \n", "8 Text embeddings, Unimodal (text), English, 512... mit 0.210 \n", "9 Text embeddings, Unimodal (text), Multilingual... apache-2.0 0.220 \n", "10 Text embeddings, Multimodal (text&image), Engl... mit 0.250 \n", "11 Text embeddings, Unimodal (text), Multilingual... apache-2.0 0.320 \n", "12 Text embeddings, Unimodal (text), English, 512... mit 0.420 \n", "13 Text embeddings, Unimodal (text), English, 512... apache-2.0 0.430 \n", "14 Text embeddings, Multimodal (text, image), Eng... apache-2.0 0.520 \n", "15 Text embeddings, Unimodal (text), English, 819... apache-2.0 0.520 \n", "16 Text embeddings, Multimodal (text, image), Eng... apache-2.0 0.520 \n", "17 Text embeddings, Unimodal (text), English, 204... apache-2.0 0.540 \n", "18 Text embeddings, Unimodal (text), English, 512... apache-2.0 0.640 \n", "19 Text embeddings, Unimodal (text), Multilingual... apache-2.0 0.640 \n", "20 Text embeddings, Unimodal (text), Multilingual... apache-2.0 1.000 \n", "21 Text embeddings, Unimodal (text), English, 512... apache-2.0 1.020 \n", "22 Text embeddings, Unimodal (text), English, 512... mit 1.200 \n", "23 Text embeddings, Unimodal (text), English, 512... mit 1.200 \n", "24 Text embeddings, Unimodal (text), Multilingual... mit 2.240 " ], "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", " \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", "
modeldimdescriptionlicensesize_in_GB
0BAAI/bge-small-en-v1.5384Text embeddings, Unimodal (text), English, 512...mit0.067
1BAAI/bge-small-zh-v1.5512Text embeddings, Unimodal (text), Chinese, 512...mit0.090
2snowflake/snowflake-arctic-embed-xs384Text embeddings, Unimodal (text), English, 512...apache-2.00.090
3sentence-transformers/all-MiniLM-L6-v2384Text embeddings, Unimodal (text), English, 256...apache-2.00.090
4jinaai/jina-embeddings-v2-small-en512Text embeddings, Unimodal (text), English, 819...apache-2.00.120
5BAAI/bge-small-en384Text embeddings, Unimodal (text), English, 512...mit0.130
6snowflake/snowflake-arctic-embed-s384Text embeddings, Unimodal (text), English, 512...apache-2.00.130
7nomic-ai/nomic-embed-text-v1.5-Q768Text embeddings, Multimodal (text, image), Eng...apache-2.00.130
8BAAI/bge-base-en-v1.5768Text embeddings, Unimodal (text), English, 512...mit0.210
9sentence-transformers/paraphrase-multilingual-...384Text embeddings, Unimodal (text), Multilingual...apache-2.00.220
10Qdrant/clip-ViT-B-32-text512Text embeddings, Multimodal (text&image), Engl...mit0.250
11jinaai/jina-embeddings-v2-base-de768Text embeddings, Unimodal (text), Multilingual...apache-2.00.320
12BAAI/bge-base-en768Text embeddings, Unimodal (text), English, 512...mit0.420
13snowflake/snowflake-arctic-embed-m768Text embeddings, Unimodal (text), English, 512...apache-2.00.430
14nomic-ai/nomic-embed-text-v1.5768Text embeddings, Multimodal (text, image), Eng...apache-2.00.520
15jinaai/jina-embeddings-v2-base-en768Text embeddings, Unimodal (text), English, 819...apache-2.00.520
16nomic-ai/nomic-embed-text-v1768Text embeddings, Multimodal (text, image), Eng...apache-2.00.520
17snowflake/snowflake-arctic-embed-m-long768Text embeddings, Unimodal (text), English, 204...apache-2.00.540
18mixedbread-ai/mxbai-embed-large-v11024Text embeddings, Unimodal (text), English, 512...apache-2.00.640
19jinaai/jina-embeddings-v2-base-code768Text embeddings, Unimodal (text), Multilingual...apache-2.00.640
20sentence-transformers/paraphrase-multilingual-...768Text embeddings, Unimodal (text), Multilingual...apache-2.01.000
21snowflake/snowflake-arctic-embed-l1024Text embeddings, Unimodal (text), English, 512...apache-2.01.020
22thenlper/gte-large1024Text embeddings, Unimodal (text), English, 512...mit1.200
23BAAI/bge-large-en-v1.51024Text embeddings, Unimodal (text), English, 512...mit1.200
24intfloat/multilingual-e5-large1024Text embeddings, Unimodal (text), Multilingual...mit2.240
\n", "
" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 12 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Supported Sparse Text Embedding Models" ] }, { "cell_type": "code", "metadata": { "ExecuteTime": { "end_time": "2024-11-13T09:01:07.038954Z", "start_time": "2024-11-13T09:01:07.019656Z" } }, "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", ")" ], "outputs": [ { "data": { "text/plain": [ " model vocab_size \\\n", "0 Qdrant/bm25 NaN \n", "1 Qdrant/bm42-all-minilm-l6-v2-attentions 30522.0 \n", "2 prithivida/Splade_PP_en_v1 30522.0 \n", "3 prithvida/Splade_PP_en_v1 30522.0 \n", "\n", " description license size_in_GB \\\n", "0 BM25 as sparse embeddings meant to be used wit... apache-2.0 0.010 \n", "1 Light sparse embedding model, which assigns an... apache-2.0 0.090 \n", "2 Independent Implementation of SPLADE++ Model f... apache-2.0 0.532 \n", "3 Independent Implementation of SPLADE++ Model f... apache-2.0 0.532 \n", "\n", " requires_idf \n", "0 True \n", "1 True \n", "2 NaN \n", "3 NaN " ], "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", "
modelvocab_sizedescriptionlicensesize_in_GBrequires_idf
0Qdrant/bm25NaNBM25 as sparse embeddings meant to be used wit...apache-2.00.010True
1Qdrant/bm42-all-minilm-l6-v2-attentions30522.0Light sparse embedding model, which assigns an...apache-2.00.090True
2prithivida/Splade_PP_en_v130522.0Independent Implementation of SPLADE++ Model f...apache-2.00.532NaN
3prithvida/Splade_PP_en_v130522.0Independent Implementation of SPLADE++ Model f...apache-2.00.532NaN
\n", "
" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 13 }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "## Supported Late Interaction Text Embedding Models" ] }, { "cell_type": "code", "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-11-13T09:01:08.074442Z", "start_time": "2024-11-13T09:01:08.056138Z" } }, "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", ")" ], "outputs": [ { "data": { "text/plain": [ " model dim \\\n", "0 answerdotai/answerai-colbert-small-v1 96 \n", "1 colbert-ir/colbertv2.0 128 \n", "2 jinaai/jina-colbert-v2 128 \n", "\n", " description license \\\n", "0 Text embeddings, Unimodal (text), Multilingual... apache-2.0 \n", "1 Late interaction model mit \n", "2 New model that expands capabilities of colbert... cc-by-nc-4.0 \n", "\n", " size_in_GB additional_files \n", "0 0.13 NaN \n", "1 0.44 NaN \n", "2 2.24 [onnx/model.onnx_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", "
modeldimdescriptionlicensesize_in_GBadditional_files
0answerdotai/answerai-colbert-small-v196Text embeddings, Unimodal (text), Multilingual...apache-2.00.13NaN
1colbert-ir/colbertv2.0128Late interaction modelmit0.44NaN
2jinaai/jina-colbert-v2128New model that expands capabilities of colbert...cc-by-nc-4.02.24[onnx/model.onnx_data]
\n", "
" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 14 }, { "cell_type": "markdown", "metadata": { "collapsed": false }, "source": [ "## Supported Image Embedding Models" ] }, { "cell_type": "code", "metadata": { "collapsed": false, "ExecuteTime": { "end_time": "2024-11-13T09:01:09.171647Z", "start_time": "2024-11-13T09:01:09.150940Z" } }, "source": [ "(\n", " pd.DataFrame(ImageEmbedding.list_supported_models())\n", " .sort_values(\"size_in_GB\")\n", " .drop(columns=[\"sources\", \"model_file\"])\n", " .reset_index(drop=True)\n", ")" ], "outputs": [ { "data": { "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 license size_in_GB \n", "0 Image embeddings, Unimodal (image), 2016 year apache-2.0 0.10 \n", "1 Image embeddings, Multimodal (text&image), 202... mit 0.34 \n", "2 Image embeddings, Multimodal (text&image), 202... apache-2.0 0.48 \n", "3 Image embeddings (more detailed than Unicom-Vi... apache-2.0 0.82 " ], "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", "
modeldimdescriptionlicensesize_in_GB
0Qdrant/resnet50-onnx2048Image embeddings, Unimodal (image), 2016 yearapache-2.00.10
1Qdrant/clip-ViT-B-32-vision512Image embeddings, Multimodal (text&image), 202...mit0.34
2Qdrant/Unicom-ViT-B-32512Image embeddings, Multimodal (text&image), 202...apache-2.00.48
3Qdrant/Unicom-ViT-B-16768Image embeddings (more detailed than Unicom-Vi...apache-2.00.82
\n", "
" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 15 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Supported Rerank Cross Encoder Models" ] }, { "cell_type": "code", "metadata": { "ExecuteTime": { "end_time": "2024-11-13T09:01:10.313943Z", "start_time": "2024-11-13T09:01:10.298428Z" } }, "source": [ "(\n", " pd.DataFrame(TextCrossEncoder.list_supported_models())\n", " .sort_values(\"size_in_GB\")\n", " .drop(columns=[\"sources\", \"model_file\"])\n", " .reset_index(drop=True)\n", ")" ], "outputs": [ { "data": { "text/plain": [ " model size_in_GB \\\n", "0 Xenova/ms-marco-MiniLM-L-6-v2 0.08 \n", "1 Xenova/ms-marco-MiniLM-L-12-v2 0.12 \n", "2 jinaai/jina-reranker-v1-tiny-en 0.13 \n", "3 jinaai/jina-reranker-v1-turbo-en 0.15 \n", "4 BAAI/bge-reranker-base 1.04 \n", "5 jinaai/jina-reranker-v2-base-multilingual 1.11 \n", "\n", " description license \n", "0 MiniLM-L-6-v2 model optimized for re-ranking t... apache-2.0 \n", "1 MiniLM-L-12-v2 model optimized for re-ranking ... apache-2.0 \n", "2 Designed for blazing-fast re-ranking with 8K c... apache-2.0 \n", "3 Designed for blazing-fast re-ranking with 8K c... apache-2.0 \n", "4 BGE reranker base model for cross-encoder re-r... mit \n", "5 A multi-lingual reranker model for cross-encod... cc-by-nc-4.0 " ], "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", "
modelsize_in_GBdescriptionlicense
0Xenova/ms-marco-MiniLM-L-6-v20.08MiniLM-L-6-v2 model optimized for re-ranking t...apache-2.0
1Xenova/ms-marco-MiniLM-L-12-v20.12MiniLM-L-12-v2 model optimized for re-ranking ...apache-2.0
2jinaai/jina-reranker-v1-tiny-en0.13Designed for blazing-fast re-ranking with 8K c...apache-2.0
3jinaai/jina-reranker-v1-turbo-en0.15Designed for blazing-fast re-ranking with 8K c...apache-2.0
4BAAI/bge-reranker-base1.04BGE reranker base model for cross-encoder re-r...mit
5jinaai/jina-reranker-v2-base-multilingual1.11A multi-lingual reranker model for cross-encod...cc-by-nc-4.0
\n", "
" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 16 }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": "" } ], "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 }