diff --git a/docs/integrations/embedding/superlinked.mdx b/docs/integrations/embedding/superlinked.mdx index 1efd4fa..0a483f6 100644 --- a/docs/integrations/embedding/superlinked.mdx +++ b/docs/integrations/embedding/superlinked.mdx @@ -8,9 +8,11 @@ sidebarTitle: Superlinked ## Installation +```bash Python icon=Python pip install sie-lancedb ``` +```bash TypeScript icon=js npm install @superlinked/sie-lancedb @lancedb/lancedb ``` @@ -33,6 +35,7 @@ Supported parameters on `.create()`: ## Usage +```py Python icon=Python import lancedb from lancedb.embeddings import get_registry from lancedb.pydantic import LanceModel, Vector @@ -65,6 +68,7 @@ LanceDB handles embedding generation for both inserts and queries automatically, `SIEReranker` plugs into LanceDB's hybrid search pipeline. It uses SIE's cross-encoder `score()` to rerank combined vector + full-text search results. You need a full-text search index on the column first: +```py Python icon=Python from sie_lancedb import SIEReranker # Create FTS index for hybrid search @@ -87,6 +91,7 @@ The reranker also works with pure vector or pure FTS search via `.rerank()`. `SIEMultiVectorEmbeddingFunction` (registered as `"sie-multivector"`) works with LanceDB's native `MultiVector` type and MaxSim scoring for ColBERT and ColPali models: +```py Python icon=Python from lancedb.pydantic import MultiVector sie_colbert = get_registry().get("sie-multivector").create( @@ -109,7 +114,7 @@ results = table.search("What is ML?").limit(5).to_list() `SIEExtractor` adds entity extraction to LanceDB's data-enrichment workflows. Extract entities from a text column and merge the results back as a structured Arrow column - enabling filtered search on extracted entities: -```python +```py Python icon=Python from sie_lancedb import SIEExtractor extractor = SIEExtractor( diff --git a/docs/snippets/quickstart.mdx b/docs/snippets/quickstart.mdx index f4272aa..bd817e6 100644 --- a/docs/snippets/quickstart.mdx +++ b/docs/snippets/quickstart.mdx @@ -18,8 +18,6 @@ export const PyQuickstartVectorSearch1Async = "# Let's search for vectors simila export const PyQuickstartVectorSearch2 = "# Let's search for vectors similar to \"wizard\"\nquery_vector = [0.7, 0.3, 0.5]\n\nresults = table.search(query_vector).limit(2).to_polars()\nprint(results)\n"; -export const TsQuickstartOutputPandas = "result = await table.search(queryVector).limit(2).toArray();\n"; - export const TsQuickstartAddData = "const moreData = [\n { id: \"7\", text: \"mage\", vector: [0.6, 0.3, 0.4] },\n { id: \"8\", text: \"bard\", vector: [0.3, 0.8, 0.4] },\n];\n\n// Add data to table\nawait table.add(moreData);\n"; export const TsQuickstartCreateTable = "const data = [\n { id: \"1\", text: \"knight\", vector: [0.9, 0.4, 0.8] },\n { id: \"2\", text: \"ranger\", vector: [0.8, 0.4, 0.7] },\n { id: \"9\", text: \"priest\", vector: [0.6, 0.2, 0.6] },\n { id: \"4\", text: \"rogue\", vector: [0.7, 0.4, 0.7] },\n];\nlet table = await db.createTable(\"adventurers\", data, { mode: \"overwrite\" });\n";