From 09ce6c5bb5649dbfb9899649e341c92bcf075e8e Mon Sep 17 00:00:00 2001 From: Rithik Kumar <46047011+rithikJha@users.noreply.github.com> Date: Fri, 16 Aug 2024 21:30:45 +0530 Subject: [PATCH] docs: add vector search example (#1543) --- docs/mkdocs.yml | 2 + docs/src/assets/open_hf_space.svg | 22 ++++++ .../examples/python_examples/multimodal.md | 2 +- .../examples/python_examples/vector_search.md | 78 +++++++++++++++++++ 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 docs/src/assets/open_hf_space.svg create mode 100644 docs/src/examples/python_examples/vector_search.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index feb2a318..9059ef90 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -144,6 +144,7 @@ nav: - Build From Scratch: examples/python_examples/build_from_scratch.md - Multimodal: examples/python_examples/multimodal.md - Rag: examples/python_examples/rag.md + - Vector Search: examples/python_examples/vector_search.md - Miscellaneous: - YouTube Transcript Search: notebooks/youtube_transcript_search.ipynb - Documentation QA Bot using LangChain: notebooks/code_qa_bot.ipynb @@ -229,6 +230,7 @@ nav: - Build From Scratch: examples/python_examples/build_from_scratch.md - Multimodal: examples/python_examples/multimodal.md - Rag: examples/python_examples/rag.md + - Vector Search: examples/python_examples/vector_search.md - Miscellaneous: - YouTube Transcript Search: notebooks/youtube_transcript_search.ipynb - Documentation QA Bot using LangChain: notebooks/code_qa_bot.ipynb diff --git a/docs/src/assets/open_hf_space.svg b/docs/src/assets/open_hf_space.svg new file mode 100644 index 00000000..b5d34c54 --- /dev/null +++ b/docs/src/assets/open_hf_space.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/examples/python_examples/multimodal.md b/docs/src/examples/python_examples/multimodal.md index 6f1de8ed..2409fb2f 100644 --- a/docs/src/examples/python_examples/multimodal.md +++ b/docs/src/examples/python_examples/multimodal.md @@ -13,7 +13,7 @@ Unlock the power of multimodal search with LanceDB, enabling efficient vector-ba | **Multimodal CLIP: DiffusionDB 🌐πŸ’₯** | Revolutionize search with Multimodal CLIP and DiffusionDB, combining text and image understanding for a new dimension of discovery! πŸ”“ | [![GitHub](../../assets/github.svg)][Clip_diffusionDB_github]
[![Open In Collab](../../assets/colab.svg)][Clip_diffusionDB_colab]
[![Python](../../assets/python.svg)][Clip_diffusionDB_python]
[![Ghost](../../assets/ghost.svg)][Clip_diffusionDB_ghost] | | **Multimodal CLIP: Youtube Videos πŸ“ΉπŸ‘€** | Search Youtube videos using Multimodal CLIP, finding relevant content with ease and accuracy! 🎯 | [![Github](../../assets/github.svg)][Clip_youtube_github]
[![Open In Collab](../../assets/colab.svg)][Clip_youtube_colab]
[![Python](../../assets/python.svg)][Clip_youtube_python]
[![Ghost](../../assets/ghost.svg)][Clip_youtube_python] | | **Multimodal Image + Text Search πŸ“ΈπŸ”** | Discover relevant documents and images with a single query, using LanceDB's multimodal search capabilities to bridge the gap between text and visuals! πŸŒ‰ | [![GitHub](../../assets/github.svg)](https://github.com/lancedb/vectordb-recipes/blob/main/examples/multimodal_search)
[![Open In Collab](../../assets/colab.svg)](https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/multimodal_search/main.ipynb)
[![Python](../../assets/python.svg)](https://github.com/lancedb/vectordb-recipes/blob/main/examples/multimodal_search/main.py)
[![Ghost](../../assets/ghost.svg)](https://blog.lancedb.com/multi-modal-ai-made-easy-with-lancedb-clip-5aaf8801c939/) | -| **Cambrian-1: Vision-Centric Image Exploration πŸ”πŸ‘€** | Dive into vision-centric exploration of images with Cambrian-1, powered by LanceDB's multimodal search to uncover new insights! πŸ”Ž | [![GitHub](../../assets/github.svg)](https://www.kaggle.com/code/prasantdixit/cambrian-1-vision-centric-exploration-of-images/)
[![Open In Collab](../../assets/colab.svg)]()
[![Python](../../assets/python.svg)]()
[![Ghost](../../assets/ghost.svg)](https://blog.lancedb.com/cambrian-1-vision-centric-exploration/) | +| **Cambrian-1: Vision-Centric Image Exploration πŸ”πŸ‘€** | Dive into vision-centric exploration of images with Cambrian-1, powered by LanceDB's multimodal search to uncover new insights! πŸ”Ž | [![Kaggle](https://img.shields.io/badge/Kaggle-035a7d?style=for-the-badge&logo=kaggle&logoColor=white)](https://www.kaggle.com/code/prasantdixit/cambrian-1-vision-centric-exploration-of-images/)
[![Ghost](../../assets/ghost.svg)](https://blog.lancedb.com/cambrian-1-vision-centric-exploration/) | [Clip_diffusionDB_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/multimodal_clip_diffusiondb diff --git a/docs/src/examples/python_examples/vector_search.md b/docs/src/examples/python_examples/vector_search.md new file mode 100644 index 00000000..67000d39 --- /dev/null +++ b/docs/src/examples/python_examples/vector_search.md @@ -0,0 +1,78 @@ +**πŸ” Vector Search: Unlock Efficient Document Retrieval πŸ”“** +==================================================================== + +**Introduction** + +Unlock the power of vector search with LanceDB, a cutting-edge solution for efficient vector-based document retrieval πŸ“Š. Input text queries to find the most relevant documents from your corpus, and discover a new world of possibilities with our inbuilt hybrid search features 🌐. + +| **Vector Search** | **Description** | **Links** | +|:-----------------|:---------------|:---------| +| **Inbuilt Hybrid Search πŸ”„** | Combine the power of traditional search algorithms with LanceDB's vector-based search for a robust and efficient search experience πŸ“Š | [![Github](../../assets/github.svg)][inbuilt_hybrid_search_github]
[![Open In Collab](../../assets/colab.svg)][inbuilt_hybrid_search_colab] | +| **Hybrid Search with BM25 and LanceDB πŸ’‘** | Synergizes BM25's keyword-focused precision (term frequency, document length normalization, bias-free retrieval) with LanceDB's semantic understanding (contextual analysis, query intent alignment) for nuanced search results in complex datasets πŸ“ˆ | [![Github](../../assets/github.svg)][BM25_github]
[![Open In Collab](../../assets/colab.svg)][BM25_colab]
[![Ghost](../../assets/ghost.svg)][BM25_ghost] | +| **NER-powered Semantic Search πŸ”Ž** | Unlock contextual understanding with Named Entity Recognition (NER) methods: Dictionary-Based, Rule-Based, and Deep Learning-Based, to accurately identify and extract entities, enabling precise semantic search results πŸ—‚οΈ | [![Github](../../assets/github.svg)][NER_github]
[![Open In Collab](../../assets/colab.svg)][NER_colab]
[![Ghost](../../assets/ghost.svg)][NER_ghost]| +| **Audio Similarity Search using Vector Embeddings 🎡** | Create vector embeddings of audio files to find similar audio content, enabling efficient audio similarity search and retrieval in LanceDB's vector store πŸ“» |[![Github](../../assets/github.svg)][audio_search_github]
[![Open In Collab](../../assets/colab.svg)][audio_search_colab]
[![Python](../../assets/python.svg)][audio_search_python]| +| **LanceDB Embeddings API: Multi-lingual Semantic Search 🌎** | Build a universal semantic search table with LanceDB's Embeddings API, supporting multiple languages (e.g., English, French) using cohere's multi-lingual model, for accurate cross-lingual search results πŸ“„ | [![Github](../../assets/github.svg)][mls_github]
[![Open In Collab](../../assets/colab.svg)][mls_colab]
[![Python](../../assets/python.svg)][mls_python] | +| **Facial Recognition: Face Embeddings πŸ€–** | Detect, crop, and embed faces using Facenet, then store and query face embeddings in LanceDB for efficient facial recognition and top-K matching results πŸ‘₯ | [![Github](../../assets/github.svg)][fr_github]
[![Open In Collab](../../assets/colab.svg)][fr_colab] | +| **Sentiment Analysis: Hotel Reviews 🏨** | Analyze customer sentiments towards the hotel industry using BERT models, storing sentiment labels, scores, and embeddings in LanceDB, enabling queries on customer opinions and potential areas for improvement πŸ’¬ | [![Github](../../assets/github.svg)][sentiment_analysis_github]
[![Open In Collab](../../assets/colab.svg)][sentiment_analysis_colab]
[![Ghost](../../assets/ghost.svg)][sentiment_analysis_ghost] | +| **Vector Arithmetic with LanceDB βš–οΈ** | Unlock powerful semantic search capabilities by performing vector arithmetic on embeddings, enabling complex relationships and nuances in data to be captured, and simplifying the process of retrieving semantically similar results πŸ“Š | [![Github](../../assets/github.svg)][arithmetic_github]
[![Open In Collab](../../assets/colab.svg)][arithmetic_colab]
[![Ghost](../../assets/ghost.svg)][arithmetic_ghost] | +| **Imagebind Demo πŸ–ΌοΈ** | Explore the multi-modal capabilities of Imagebind through a Gradio app, leveraging LanceDB API for seamless image search and retrieval experiences πŸ“Έ | [![Github](../../assets/github.svg)][imagebind_github]
[![Open in Spaces](../../assets/open_hf_space.svg)][imagebind_huggingface] | +| **Search Engine using SAM & CLIP πŸ”** | Build a search engine within an image using SAM and CLIP models, enabling object-level search and retrieval, with LanceDB indexing and search capabilities to find the closest match between image embeddings and user queries πŸ“Έ | [![Github](../../assets/github.svg)][swi_github]
[![Open In Collab](../../assets/colab.svg)][swi_colab]
[![Ghost](../../assets/ghost.svg)][swi_ghost] | +| **Zero Shot Object Localization and Detection with CLIP πŸ”Ž** | Perform object detection on images using OpenAI's CLIP, enabling zero-shot localization and detection of objects, with capabilities to split images into patches, parse with CLIP, and plot bounding boxes πŸ“Š | [![Github](../../assets/github.svg)][zsod_github]
[![Open In Collab](../../assets/colab.svg)][zsod_colab] | +| **Accelerate Vector Search with OpenVINO πŸš€** | Boost vector search applications using OpenVINO, achieving significant speedups with CLIP for text-to-image and image-to-image searching, through PyTorch model optimization, FP16 and INT8 format conversion, and quantization with OpenVINO NNCF πŸ“ˆ | [![Github](../../assets/github.svg)][openvino_github]
[![Open In Collab](../../assets/colab.svg)][openvino_colab]
[![Ghost](../../assets/ghost.svg)][openvino_ghost] | +| **Zero-Shot Image Classification with CLIP and LanceDB πŸ“Έ** | Achieve zero-shot image classification using CLIP and LanceDB, enabling models to classify images without prior training on specific use cases, unlocking flexible and adaptable image classification capabilities πŸ”“ | [![Github](../../assets/github.svg)][zsic_github]
[![Open In Collab](../../assets/colab.svg)][zsic_colab]
[![Ghost](../../assets/ghost.svg)][zsic_ghost] | + + + + +[inbuilt_hybrid_search_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/Inbuilt-Hybrid-Search +[inbuilt_hybrid_search_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Inbuilt-Hybrid-Search/Inbuilt_Hybrid_Search_with_LanceDB.ipynb + +[BM25_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/Hybrid_search_bm25_lancedb +[BM25_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Hybrid_search_bm25_lancedb/main.ipynb +[BM25_ghost]: https://blog.lancedb.com/hybrid-search-combining-bm25-and-semantic-search-for-better-results-with-lan-1358038fe7e6 + +[NER_github]: https://github.com/lancedb/vectordb-recipes/blob/main/tutorials/NER-powered-Semantic-Search +[NER_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/tutorials/NER-powered-Semantic-Search/NER_powered_Semantic_Search_with_LanceDB.ipynb +[NER_ghost]: https://blog.lancedb.com/ner-powered-semantic-search-using-lancedb-51051dc3e493 + +[audio_search_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/audio_search +[audio_search_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/audio_search/main.ipynb +[audio_search_python]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/audio_search/main.py + +[mls_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/multi-lingual-wiki-qa +[mls_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/multi-lingual-wiki-qa/main.ipynb +[mls_python]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/multi-lingual-wiki-qa/main.py + +[fr_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/facial_recognition +[fr_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/facial_recognition/main.ipynb + +[sentiment_analysis_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/Sentiment-Analysis-Analyse-Hotel-Reviews +[sentiment_analysis_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Sentiment-Analysis-Analyse-Hotel-Reviews/Sentiment_Analysis_using_LanceDB.ipynb +[sentiment_analysis_ghost]: https://blog.lancedb.com/sentiment-analysis-using-lancedb-2da3cb1e3fa6 + +[arithmetic_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/Vector-Arithmetic-with-LanceDB +[arithmetic_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Vector-Arithmetic-with-LanceDB/main.ipynb +[arithmetic_ghost]: https://blog.lancedb.com/vector-arithmetic-with-lancedb-an-intro-to-vector-embeddings/ + +[imagebind_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/imagebind_demo +[imagebind_huggingface]: https://huggingface.co/spaces/raghavd99/imagebind2 + +[swi_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/search-within-images-with-sam-and-clip +[swi_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/search-within-images-with-sam-and-clip/main.ipynb +[swi_ghost]: https://blog.lancedb.com/search-within-an-image-331b54e4285e + +[zsod_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/zero-shot-object-detection-CLIP +[zsod_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/zero-shot-object-detection-CLIP/zero_shot_object_detection_clip.ipynb + +[openvino_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/Accelerate-Vector-Search-Applications-Using-OpenVINO +[openvino_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Accelerate-Vector-Search-Applications-Using-OpenVINO/clip_text_image_search.ipynb +[openvino_ghost]: https://blog.lancedb.com/accelerate-vector-search-applications-using-openvino-lancedb/ + +[zsic_github]: https://github.com/lancedb/vectordb-recipes/blob/main/examples/zero-shot-image-classification +[zsic_colab]: https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/zero-shot-image-classification/main.ipynb +[zsic_ghost]: https://blog.lancedb.com/zero-shot-image-classification-with-vector-search/ + + + + +