diff --git a/python-recipes/vector-search/02_hybrid_search.ipynb b/python-recipes/vector-search/02_hybrid_search.ipynb index 9a796955..f36b055c 100644 --- a/python-recipes/vector-search/02_hybrid_search.ipynb +++ b/python-recipes/vector-search/02_hybrid_search.ipynb @@ -125,7 +125,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 58, "metadata": {}, "outputs": [], "source": [ @@ -152,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 59, "metadata": {}, "outputs": [], "source": [ @@ -163,7 +163,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 60, "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 61, "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 62, "metadata": {}, "outputs": [], "source": [ @@ -201,7 +201,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 63, "metadata": {}, "outputs": [ { @@ -211,20 +211,20 @@ " 'genre': 'action',\n", " 'rating': 7,\n", " 'description': 'A daring cop chases a notorious criminal across the city in a high-stakes game of cat and mouse.',\n", - " 'description_vector': b'\\x9bf|=\\x0e`\\n;\"\\x92\\xb7;<\\xcb~\\xbd\\xfad\\xce\\xbb\\xc3\\x16J=V\\xa7?=\\xedv\\x95\\xaa\\x1c=\\xfd\\xee\\x89<\\xbd\\xb0-<\\x82\\xb2\\x9f\\xbc[\\x0b\\xc3\\xbd\\x98NR=xl\\xf7\\xbcN>\\x17\\xbe#\\x12\\x05\\xb99u\\xbf<\\xb0\\xe0b\\xba\\xd3\\xa6\\xa8\\xbdx\\xdc\\xec\\xbcRc%=\\xe4\\xe7r\\xbb\\x1eOG=?(\\x85=o@\\xa2\\xbc2Z\\xd0\\xbdC%K\\xbd\\xb9\\xed\\x94\\xbcR\\xddH=\\x92&F<\\xc6*\\xec<\\x90\\xd8\\x8d\\xbd\\xcbZ\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\r\\xe9<\\xbc\\xb7\\x8e=\\xf0X\\xa9=\\x1a<\\x18\\xba\\x87U\\x15\\xbd\\x02I\\x00\\xbdBg\\xa2;~\\xb0\\xb3\\xbd\\x8c\\x8c =\\xd1\\x7fv\\xbb\\x16y\\x84\\xbc\\xa5\\'\\xd8\\xba\\x19\\x92\\xa5\\xbc\\r\\x1b)\\xbc(3\\xae\\xbb\\x16O\\x95<\\xfe\\x82\\x9d\\xbc\\x8bO\\x08<\\x0fk\\x93\\xbb\\x01!\\xe7\\xbaA\\x94\\x82=\\xf59\\n='}]" ] }, - "execution_count": 6, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -244,14 +244,14 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 64, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "12:50:10 redisvl.index.index INFO Index already exists, overwriting.\n" + "12:41:14 redisvl.index.index INFO Index already exists, overwriting.\n" ] } ], @@ -300,35 +300,35 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 65, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "['movie:0d8537e75af24af6b118f4629c2758a3',\n", - " 'movie:28c6547937a7402cba307cbe113c322f',\n", - " 'movie:d9bb23e83e1c41ad89f5de18ea5c65d6',\n", - " 'movie:b1d51e082d954d2eb00690885b601e76',\n", - " 'movie:54c806022aae415b9e1e23a110ca78d4',\n", - " 'movie:b81aad8ca262422cb80ba725b17afce4',\n", - " 'movie:54501580991a4e509194de51e9243159',\n", - " 'movie:1b184aed092e4a83a9b9ff15ae38b9b3',\n", - " 'movie:2b57e7ff370347528f0d1007bf7b9efd',\n", - " 'movie:ff0a1ca4f858447aab548bd9e12106cf',\n", - " 'movie:b0d7a84540f644099f411e7a5e2324c2',\n", - " 'movie:563bc43778494fe49ecb4884c20a0015',\n", - " 'movie:317ca39cce5e4817a153fa24821c83dc',\n", - " 'movie:ae506669d2fb47988398b6ea70c76a43',\n", - " 'movie:22c9dd9473104cde933a8d7918818fd5',\n", - " 'movie:dba67e0f8f4f45e38ba58533a7e70ec3',\n", - " 'movie:2f6abe9b28034db58e37d9b3cf4b0e96',\n", - " 'movie:64282c7d9f654e2d9c607a025ca25f2f',\n", - " 'movie:88b925781ac84dceb267ab92015450f1',\n", - " 'movie:8db639fc4fc44771b8e3285bf6a236e8']" + "['movie:01JQC7NC1JXCDCBZY83G914DZD',\n", + " 'movie:01JQC7NC1JQQ63GN6QZN2TSYAF',\n", + " 'movie:01JQC7NC1JJPZYMZ74B6ATQ37V',\n", + " 'movie:01JQC7NC1JY715NWCSJX0VCM0Q',\n", + " 'movie:01JQC7NC1JHRSWD1DFGC0W3P61',\n", + " 'movie:01JQC7NC1KEEH4ZSA5R1PQAPZM',\n", + " 'movie:01JQC7NC1KCT1GPTQHBM5Y37XG',\n", + " 'movie:01JQC7NC1KRJSTFT32BSE8SK1V',\n", + " 'movie:01JQC7NC1KA3AFNM187PHBZZ0T',\n", + " 'movie:01JQC7NC1K33J6DW2MK88HWM3F',\n", + " 'movie:01JQC7NC1KVYFHXVEM30E41HN9',\n", + " 'movie:01JQC7NC1KYN9WDY2MDNB6JGB6',\n", + " 'movie:01JQC7NC1K9YSWW7FT0379TJX9',\n", + " 'movie:01JQC7NC1K27YQT742HRFTFQVM',\n", + " 'movie:01JQC7NC1KWC3Y75RP97X8M6VD',\n", + " 'movie:01JQC7NC1KPM2X2EJAQ8DFP1W7',\n", + " 'movie:01JQC7NC1KMH8VWWG65Y3YV5CJ',\n", + " 'movie:01JQC7NC1KB30XEN6P1MQ7BJQW',\n", + " 'movie:01JQC7NC1KTPAB7KX5H6AASPB9',\n", + " 'movie:01JQC7NC1KX18AVM8MC3S7D1FQ']" ] }, - "execution_count": 8, + "execution_count": 65, "metadata": {}, "output_type": "execute_result" } @@ -350,7 +350,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 87, "metadata": {}, "outputs": [], "source": [ @@ -367,7 +367,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 89, "metadata": {}, "outputs": [ { @@ -376,12 +376,16 @@ "'action | adventure | movie | great | fighting | scenes | crime | busting | superheroes | magic'" ] }, - "execution_count": 10, + "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "from redisvl.utils.token_escaper import TokenEscaper\n", + "\n", + "escaper = TokenEscaper()\n", + "\n", "# list of stopwords to filter out noise from query string\n", "stopwords = set([\n", " \"a\", \"is\", \"the\", \"an\", \"and\", \"are\", \"as\", \"at\", \"be\", \"but\", \"by\", \"for\",\n", @@ -391,8 +395,8 @@ "\n", "def tokenize_query(user_query: str) -> str:\n", " \"\"\"Convert a raw user query to a redis full text query joined by ORs\"\"\"\n", - " tokens = [token.strip().strip(\",\").lower() for token in user_query.split()]\n", - " return \" | \".join([token for token in tokens if token not in stopwords])\n", + " tokens = [escaper.escape(token.strip().strip(\",\").lower()) for token in user_query.split()]\n", + " return \" | \".join([token for token in tokens if token and token not in stopwords])\n", "\n", "# Example\n", "tokenize_query(user_query)" @@ -407,7 +411,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 68, "metadata": {}, "outputs": [], "source": [ @@ -438,8 +442,8 @@ " filter_expression=f\"~({Text(text_field) % tokenize_query(user_query)})\",\n", " num_results=num_results,\n", " return_fields=[\"title\", \"description\"],\n", - " dialect=4,\n", - " ).scorer(\"BM25\").with_scores()" + " dialect=2,\n", + " ).scorer(\"BM25STD\").with_scores()" ] }, { @@ -462,27 +466,27 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 69, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[{'id': 'movie:dba67e0f8f4f45e38ba58533a7e70ec3',\n", - " 'vector_distance': '0.643690049648',\n", + "[{'id': 'movie:01JQC7NC1KPM2X2EJAQ8DFP1W7',\n", + " 'vector_distance': '0.643690168858',\n", " 'title': 'The Incredibles',\n", " 'description': \"A family of undercover superheroes, while trying to live the quiet suburban life, are forced into action to save the world. Bob Parr (Mr. Incredible) and his wife Helen (Elastigirl) were among the world's greatest crime fighters, but now they must assume civilian identities and retreat to the suburbs to live a 'normal' life with their three children. However, the family's desire to help the world pulls them back into action when they face a new and dangerous enemy.\"},\n", - " {'id': 'movie:0d8537e75af24af6b118f4629c2758a3',\n", - " 'vector_distance': '0.668439269066',\n", + " {'id': 'movie:01JQC7NC1JXCDCBZY83G914DZD',\n", + " 'vector_distance': '0.66843944788',\n", " 'title': 'Explosive Pursuit',\n", " 'description': 'A daring cop chases a notorious criminal across the city in a high-stakes game of cat and mouse.'},\n", - " {'id': 'movie:b81aad8ca262422cb80ba725b17afce4',\n", - " 'vector_distance': '0.698122382164',\n", + " {'id': 'movie:01JQC7NC1KEEH4ZSA5R1PQAPZM',\n", + " 'vector_distance': '0.698122441769',\n", " 'title': 'Mad Max: Fury Road',\n", " 'description': \"In a post-apocalyptic wasteland, Max teams up with Furiosa to escape a tyrant's clutches and find freedom.\"}]" ] }, - "execution_count": 12, + "execution_count": 69, "metadata": {}, "output_type": "execute_result" } @@ -503,7 +507,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 70, "metadata": {}, "outputs": [ { @@ -512,7 +516,7 @@ "'(~@description:(action | adventure | movie | great | fighting | scenes | crime | busting | superheroes | magic))=>[KNN 3 @description_vector $vector AS vector_distance]'" ] }, - "execution_count": 13, + "execution_count": 70, "metadata": {}, "output_type": "execute_result" } @@ -540,36 +544,36 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 92, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[{'vector_distance': '0.643690049648',\n", - " '__score': '0.968066079387',\n", + "[{'vector_distance': '0.643690168858',\n", + " '__score': '5.82636454242',\n", " 'title': 'The Incredibles',\n", " 'description': \"A family of undercover superheroes, while trying to live the quiet suburban life, are forced into action to save the world. Bob Parr (Mr. Incredible) and his wife Helen (Elastigirl) were among the world's greatest crime fighters, but now they must assume civilian identities and retreat to the suburbs to live a 'normal' life with their three children. However, the family's desire to help the world pulls them back into action when they face a new and dangerous enemy.\",\n", - " 'cosine_similarity': '0.678154975176',\n", - " 'bm25_score': '0.968066079387',\n", - " 'hybrid_score': '0.765128306439'},\n", - " {'vector_distance': '0.668439269066',\n", + " 'cosine_similarity': '0.678154915571',\n", + " 'bm25_score': '5.82636454242',\n", + " 'hybrid_score': '2.22261780363'},\n", + " {'vector_distance': '0.66843944788',\n", " '__score': '0',\n", " 'title': 'Explosive Pursuit',\n", " 'description': 'A daring cop chases a notorious criminal across the city in a high-stakes game of cat and mouse.',\n", - " 'cosine_similarity': '0.665780365467',\n", + " 'cosine_similarity': '0.66578027606',\n", " 'bm25_score': '0',\n", - " 'hybrid_score': '0.466046255827'},\n", - " {'vector_distance': '0.698122382164',\n", + " 'hybrid_score': '0.466046193242'},\n", + " {'vector_distance': '0.698122441769',\n", " '__score': '0',\n", " 'title': 'Mad Max: Fury Road',\n", " 'description': \"In a post-apocalyptic wasteland, Max teams up with Furiosa to escape a tyrant's clutches and find freedom.\",\n", - " 'cosine_similarity': '0.650938808918',\n", + " 'cosine_similarity': '0.650938779116',\n", " 'bm25_score': '0',\n", - " 'hybrid_score': '0.455657166243'}]" + " 'hybrid_score': '0.455657145381'}]" ] }, - "execution_count": 14, + "execution_count": 92, "metadata": {}, "output_type": "execute_result" } @@ -581,13 +585,13 @@ "# Build the aggregation request\n", "req = (\n", " AggregateRequest(query.query_string())\n", - " .scorer(\"BM25\")\n", + " .scorer(\"BM25STD\")\n", " .add_scores()\n", " .apply(cosine_similarity=\"(2 - @vector_distance)/2\", bm25_score=\"@__score\")\n", " .apply(hybrid_score=f\"0.3*@bm25_score + 0.7*@cosine_similarity\")\n", " .load(\"title\", \"description\", \"cosine_similarity\", \"bm25_score\", \"hybrid_score\")\n", " .sort_by(Desc(\"@hybrid_score\"), max=3)\n", - " .dialect(4)\n", + " .dialect(2)\n", ")\n", "\n", "# Run the query\n", @@ -620,7 +624,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 90, "metadata": {}, "outputs": [], "source": [ @@ -634,13 +638,13 @@ " # Build aggregation\n", " req = (\n", " AggregateRequest(query.query_string())\n", - " .scorer(\"BM25\")\n", + " .scorer(\"BM25STD\")\n", " .add_scores()\n", " .apply(cosine_similarity=\"(2 - @vector_distance)/2\", bm25_score=\"@__score\")\n", " .apply(hybrid_score=f\"{1-alpha}*@bm25_score + {alpha}*@cosine_similarity\")\n", " .sort_by(Desc(\"@hybrid_score\"), max=num_results)\n", " .load(\"title\", \"description\", \"cosine_similarity\", \"bm25_score\", \"hybrid_score\")\n", - " .dialect(4)\n", + " .dialect(2)\n", " )\n", "\n", " # Run the query\n", @@ -654,21 +658,21 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 91, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[('The Incredibles', '0.765128306439'),\n", - " ('Explosive Pursuit', '0.466046255827'),\n", - " ('Mad Max: Fury Road', '0.455657166243'),\n", + "[('The Incredibles', '2.22261780363'),\n", + " ('Explosive Pursuit', '0.466046193242'),\n", + " ('Mad Max: Fury Road', '0.455657145381'),\n", " ('The Dark Knight', '0.452280691266'),\n", - " ('Despicable Me', '0.448826777935'),\n", - " ('Inception', '0.434456580877')]" + " ('Despicable Me', '0.448826736212'),\n", + " ('Inception', '0.434456560016')]" ] }, - "execution_count": 16, + "execution_count": 91, "metadata": {}, "output_type": "execute_result" } @@ -693,7 +697,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 74, "metadata": {}, "outputs": [], "source": [ @@ -721,7 +725,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 75, "metadata": {}, "outputs": [ { @@ -737,7 +741,7 @@ " (8, 0.015384615384615385)]" ] }, - "execution_count": 18, + "execution_count": 75, "metadata": {}, "output_type": "execute_result" } @@ -749,7 +753,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 76, "metadata": {}, "outputs": [], "source": [ @@ -780,21 +784,21 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 77, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[('The Incredibles', 0.016009221311475412),\n", + "[('The Incredibles', 0.01639344262295082),\n", " ('Explosive Pursuit', 0.01575682382133995),\n", " ('Mad Max: Fury Road', 0.015079365079365078),\n", - " ('Finding Nemo', 0.015008960573476702),\n", " ('Fast & Furious 9', 0.014925373134328358),\n", + " ('Finding Nemo', 0.01488095238095238),\n", " ('The Dark Knight', 0.014854753521126762)]" ] }, - "execution_count": 20, + "execution_count": 77, "metadata": {}, "output_type": "execute_result" } @@ -813,13 +817,13 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 78, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[('The Incredibles', 0.016162909836065574),\n", + "[('The Incredibles', 0.01639344262295082),\n", " ('Explosive Pursuit', 0.015905707196029777),\n", " ('Mad Max: Fury Road', 0.015396825396825395),\n", " ('The Dark Knight', 0.015162852112676057),\n", @@ -827,7 +831,7 @@ " ('Inception', 0.014715649647156496)]" ] }, - "execution_count": 21, + "execution_count": 78, "metadata": {}, "output_type": "execute_result" } @@ -847,80 +851,9 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 79, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "349ccd5a976f4283866adfc290ab85ea", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "config.json: 0%| | 0.00/794 [00:00I'm in the mood for a high-rated action movie ...\n", " [(Explosive Pursuit, -11.244140625), (Mad Max:...\n", " [(The Incredibles, 0.016029143897996357), (Mad...\n", - " [(The Incredibles, 0.552392209158), (Despicabl...\n", + " [(The Incredibles, 1.09860771359), (Despicable...\n", " \n", " \n", " 1\n", " What's a funny animated film about unlikely fr...\n", - " [(Despicable Me, -10.441911697387695), (The In...\n", + " [(Despicable Me, -10.441909790039062), (The In...\n", " [(Black Widow, 0.015625), (The Incredibles, 0....\n", - " [(The Incredibles, 0.454752022028), (Despicabl...\n", + " [(The Incredibles, 0.454752063751), (Despicabl...\n", " \n", " \n", " 2\n", " Any movies featuring superheroes or extraordin...\n", - " [(The Incredibles, -3.6648106575012207), (The ...\n", + " [(The Incredibles, -3.6648082733154297), (The ...\n", " [(The Incredibles, 0.01639344262295082), (Mad ...\n", - " [(The Incredibles, 0.603234936448), (The Aveng...\n", + " [(The Incredibles, 1.05887192239), (The Avenge...\n", " \n", " \n", " 3\n", " I want to watch a thrilling movie with spies o...\n", " [(The Incredibles, -10.843631744384766), (Expl...\n", " [(Skyfall, 0.01631411951348493), (Explosive Pu...\n", - " [(Skyfall, 0.44384047389), (Despicable Me, 0.4...\n", + " [(Skyfall, 0.443840536475), (Despicable Me, 0....\n", " \n", " \n", " 4\n", " Are there any comedies set in unusual location...\n", " [(The Incredibles, -11.45376968383789), (Explo...\n", " [(Madagascar, 0.015272878190495952), (Explosiv...\n", - " [(Madagascar, 0.442132177949), (Despicable Me,...\n", + " [(Madagascar, 0.442132198811), (Despicable Me,...\n", " \n", " \n", "\n", @@ -1145,8 +1078,8 @@ "\n", " hf-cross-encoder \\\n", "0 [(Explosive Pursuit, -11.244140625), (Mad Max:... \n", - "1 [(Despicable Me, -10.441911697387695), (The In... \n", - "2 [(The Incredibles, -3.6648106575012207), (The ... \n", + "1 [(Despicable Me, -10.441909790039062), (The In... \n", + "2 [(The Incredibles, -3.6648082733154297), (The ... \n", "3 [(The Incredibles, -10.843631744384766), (Expl... \n", "4 [(The Incredibles, -11.45376968383789), (Explo... \n", "\n", @@ -1158,14 +1091,14 @@ "4 [(Madagascar, 0.015272878190495952), (Explosiv... \n", "\n", " linear-combo-bm25-cosine \n", - "0 [(The Incredibles, 0.552392209158), (Despicabl... \n", - "1 [(The Incredibles, 0.454752022028), (Despicabl... \n", - "2 [(The Incredibles, 0.603234936448), (The Aveng... \n", - "3 [(Skyfall, 0.44384047389), (Despicable Me, 0.4... \n", - "4 [(Madagascar, 0.442132177949), (Despicable Me,... " + "0 [(The Incredibles, 1.09860771359), (Despicable... \n", + "1 [(The Incredibles, 0.454752063751), (Despicabl... \n", + "2 [(The Incredibles, 1.05887192239), (The Avenge... \n", + "3 [(Skyfall, 0.443840536475), (Despicable Me, 0.... \n", + "4 [(Madagascar, 0.442132198811), (Despicable Me,... " ] }, - "execution_count": 27, + "execution_count": 84, "metadata": {}, "output_type": "execute_result" } @@ -1176,20 +1109,20 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 85, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['Show me movies set in dystopian or post-apocalyptic worlds',\n", - " list([('Mad Max: Fury Road', -3.490626335144043), ('Despicable Me', -11.051526069641113), ('The Incredibles', -11.315656661987305), ('Black Widow', -10.880638122558594)]),\n", + " list([('Mad Max: Fury Road', -3.4906280040740967), ('Despicable Me', -11.051526069641113), ('The Incredibles', -11.315656661987305), ('Black Widow', -10.880638122558594)]),\n", " list([('Mad Max: Fury Road', 0.01602086438152012), ('Skyfall', 0.015607940446650124), ('The Incredibles', 0.015237691001697792), ('Black Widow', 0.01513526119402985)]),\n", - " list([('Mad Max: Fury Road', '0.452238571644'), ('The Incredibles', '0.445061546564'), ('Madagascar', '0.41901564002'), ('Despicable Me', '0.416218408942')])],\n", + " list([('Mad Max: Fury Road', '0.452238592505'), ('The Incredibles', '0.445061504841'), ('Madagascar', '0.419015598297'), ('Despicable Me', '0.416218388081')])],\n", " dtype=object)" ] }, - "execution_count": 28, + "execution_count": 85, "metadata": {}, "output_type": "execute_result" }