Skip to content

Commit c6c5b17

Browse files
Update semantic search examples (#10322) (#10323)
1 parent bb512fd commit c6c5b17

File tree

3 files changed

+26
-33
lines changed

3 files changed

+26
-33
lines changed

_tutorials/vector-search/index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ vector_search_101:
1616
- heading: "Getting started with semantic and hybrid search"
1717
description: "Build your first AI search application"
1818
link: "/tutorials/vector-search/neural-search-tutorial/"
19+
ai_search_types:
20+
- heading: "Semantic search"
21+
description: "Understands the meaning and intent behind a query to deliver more relevant results"
22+
link: "/vector-search/ai-search/semantic-search/"
23+
- heading: "Hybrid search"
24+
description: "Improves relevance by combining keyword-based and semantic search techniques"
25+
link: "/vector-search/ai-search/hybrid-search/"
26+
- heading: "Multimodal search"
27+
description: "Enables searching across different types of data, such as text and images"
28+
link: "/vector-search/ai-search/multimodal-search/"
29+
- heading: "Neural sparse search"
30+
description: "Uses sparse vector representations and deep learning models for efficient retrieval"
31+
link: "/vector-search/ai-search/neural-sparse-search/"
32+
- heading: "Conversational search with RAG"
33+
description: "Combines natural dialogue with retrieval-augmented generation to provide contextual answers"
34+
link: "/vector-search/ai-search/conversational-search/"
1935
other:
2036
- heading: "Vector operations"
2137
description: "Learn how to generate embeddings and optimize vector storage"
@@ -36,6 +52,10 @@ Explore the following tutorials to learn about implementing vector search applic
3652

3753
{% include cards.html cards=page.vector_search_101 %}
3854

55+
## AI search types
56+
57+
{% include cards.html cards=page.ai_search_types %}
58+
3959
## Vector search applications
4060

4161
{% include cards.html cards=page.other %}

_tutorials/vector-search/neural-search-tutorial.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ PUT _cluster/settings
5151
{
5252
"persistent": {
5353
"plugins.ml_commons.only_run_on_ml_node": "false",
54-
"plugins.ml_commons.model_access_control_enabled": "true",
5554
"plugins.ml_commons.native_memory_threshold": "99"
5655
}
5756
}
@@ -106,10 +105,10 @@ For information about choosing a model, see [Further reading](#further-reading).
106105

107106
### Step 2: Register and deploy the model
108107

109-
To register the model, provide the model group ID in the register request:
108+
To register and deploy the model, provide the model group ID in the register request:
110109

111110
```json
112-
POST /_plugins/_ml/models/_register
111+
POST /_plugins/_ml/models/_register?deploy=true
113112
{
114113
"name": "huggingface/sentence-transformers/msmarco-distilbert-base-tas-b",
115114
"version": "1.0.3",
@@ -205,32 +204,7 @@ The response contains the model information. You can see that the `model_state`
205204

206205
#### Advanced: Registering a custom model
207206

208-
To register a custom model, you must provide a model configuration in the register request. For example, the following is a register request containing the full format for the model used in this tutorial:
209-
210-
```json
211-
POST /_plugins/_ml/models/_register
212-
{
213-
"name": "sentence-transformers/msmarco-distilbert-base-tas-b",
214-
"version": "1.0.1",
215-
"description": "This is a port of the DistilBert TAS-B Model to sentence-transformers model: It maps sentences & paragraphs to a 768 dimensional dense vector space and is optimized for the task of semantic search.",
216-
"model_task_type": "TEXT_EMBEDDING",
217-
"model_format": "ONNX",
218-
"model_content_size_in_bytes": 266291330,
219-
"model_content_hash_value": "a3c916f24239fbe32c43be6b24043123d49cd2c41b312fc2b29f2fc65e3c424c",
220-
"model_config": {
221-
"model_type": "distilbert",
222-
"embedding_dimension": 768,
223-
"framework_type": "huggingface_transformers",
224-
"pooling_mode": "CLS",
225-
"normalize_result": false,
226-
"all_config": "{\"_name_or_path\":\"old_models/msmarco-distilbert-base-tas-b/0_Transformer\",\"activation\":\"gelu\",\"architectures\":[\"DistilBertModel\"],\"attention_dropout\":0.1,\"dim\":768,\"dropout\":0.1,\"hidden_dim\":3072,\"initializer_range\":0.02,\"max_position_embeddings\":512,\"model_type\":\"distilbert\",\"n_heads\":12,\"n_layers\":6,\"pad_token_id\":0,\"qa_dropout\":0.1,\"seq_classif_dropout\":0.2,\"sinusoidal_pos_embds\":false,\"tie_weights_\":true,\"transformers_version\":\"4.7.0\",\"vocab_size\":30522}"
227-
},
228-
"created_time": 1676074079195,
229-
"url": "https://artifacts.opensearch.org/models/ml-models/huggingface/sentence-transformers/msmarco-distilbert-base-tas-b/1.0.1/onnx/sentence-transformers_msmarco-distilbert-base-tas-b-1.0.1-onnx.zip"
230-
}
231-
```
232-
233-
For more information, see [Using ML models within OpenSearch]({{site.url}}{{site.baseurl}}/ml-commons-plugin/using-ml-models/).
207+
To register a custom model, you must provide a model configuration in the register request. For more information, see [Using ML models within OpenSearch]({{site.url}}{{site.baseurl}}/ml-commons-plugin/using-ml-models/).
234208

235209
<details markdown="block">
236210
<summary>

_vector-search/getting-started/auto-generated-embeddings.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ PUT _cluster/settings
2323
{
2424
"persistent": {
2525
"plugins.ml_commons.only_run_on_ml_node": "false",
26-
"plugins.ml_commons.model_access_control_enabled": "true",
2726
"plugins.ml_commons.native_memory_threshold": "99"
2827
}
2928
}
@@ -261,16 +260,16 @@ You can use automated workflows to create and deploy externally hosted models an
261260

262261
### Step 1: Register and deploy the model
263262

264-
To register and deploy a model, select the built-in workflow template for the model provider. For more information, see [Supported workflow templates]({{site.url}}{{site.baseurl}}/automating-configurations/workflow-templates/#supported-workflow-templates). Alternatively, to configure a custom model, use [Step 1 of the manual setup](#step-1-register-and-deploy-the-model).
263+
To register and deploy a model, select the built-in workflow template for the model provider. For more information, see [Supported workflow templates]({{site.url}}{{site.baseurl}}/automating-configurations/workflow-templates/#supported-workflow-templates). Alternatively, to configure a custom model, use [Step 1 of the manual setup](#step-1-register-and-deploy-the-model). Note the model ID; you'll use it in the next step.
265264

266265
### Step 2: Configure a workflow
267266

268-
Create and provision a semantic search workflow. You must provide the model ID for the configured model. Review your selected workflow template [defaults](https://github.com/opensearch-project/flow-framework/blob/2.13/src/main/resources/defaults/semantic-search-defaults.json) to determine whether you need to update any of the parameters. For example, if the model dimensionality is different from the default (`1024`), specify the dimensionality of your model in the `output_dimension` parameter. Change the workflow template default text field from `passage_text` to `text` in order to match the manual example:
267+
Create and provision a semantic search workflow. You must provide the model ID for the model deployed in the previous step. Review your selected workflow template [defaults](https://github.com/opensearch-project/flow-framework/blob/2.13/src/main/resources/defaults/semantic-search-defaults.json) to determine whether you need to update any of the parameters. For example, if the model dimensionality is different from the default (`1024`), specify the dimensionality of your model in the `output_dimension` parameter. Change the workflow template default text field from `passage_text` to `text` in order to match the manual example:
269268

270269
```json
271270
POST /_plugins/_flow_framework/workflow?use_case=semantic_search&provision=true
272271
{
273-
"create_ingest_pipeline.model_id" : "mBGzipQB2gmRjlv_dOoB",
272+
"create_ingest_pipeline.model_id" : "aVeif4oB5Vm0Tdw8zYO2",
274273
"text_embedding.field_map.output.dimension": "768",
275274
"text_embedding.field_map.input": "text"
276275
}

0 commit comments

Comments
 (0)