opensearch-docs-cn/_neural-search-plugin/index.md

201 lines
6.7 KiB
Markdown
Raw Normal View History

---
layout: default
title: Neural Search plugin
nav_order: 1
has_children: false
has_toc: false
---
# Neural Search plugin
The Neural Search plugin is an experimental feature. For updates on the progress of the Neural Search plugin, or if you want to leave feedback that could help improve the feature, join the discussion in the [Neural Search forum](https://forum.opensearch.org/t/feedback-neural-search-plugin-experimental-release/11501).
{: .warning}
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
The OpenSearch Neural Search plugin enables the integration of machine learning (ML) language models into your search workloads. During ingestion and search, the Neural Search plugin transforms text into vectors. Then, Neural Search uses the transformed vectors in vector-based search.
The Neural Search plugin comes bundled with OpenSearch. For more information, see [Managing plugins](({{site.url}}{{site.baseurl}}/opensearch/install/plugins#managing-plugins)).
## Ingest data with Neural Search
In order to ingest vectorized documents, you need to create a Neural Search _pipeline_. A pipeline consists of a series of processors that manipulate documents during ingestion, allowing the documents to be vectorized. The following API operation creates a Neural Search pipeline:
```
PUT _ingest/pipeline/<pipeline_name>
```
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
In the pipeline request body, The `text_embedding` processor, the only processor supported by Neural Search, converts a document's text to vector embeddings. `text_embedding` uses `field_map`s to determine what fields from which to generate vector embeddings and also which field to store the embedding.
### Path parameter
Use `pipeline_name` to create a name for your Neural Search pipeline.
### Request fields
Field | Data Type | Description
:--- | :--- | :---
description | string | A description of the processor.
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
model_id | string | The ID of the model that will be used in the embedding interface. The model must be indexed in OpenSearch before it can be used in Neural Search. For more information, see [Model Serving Framework]
input_field_name | string | The field name used to cache text for text embeddings.
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
output_field_name | string | The name of the field in which output text is stored.
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
### Example request
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
Use the following example request to create a pipeline:
```json
PUT _ingest/pipeline/nlp-pipeline
{
"description": "An example neural search pipeline",
"processors" : [
{
"text_embedding": {
"model_id": "bxoDJ7IHGM14UqatWc_2j",
"field_map": {
"text": "text_knn"
}
}
}
]
}
```
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
### Example response
OpenSearch responds with an acknowledgment of the pipeline's creation.
```json
PUT _ingest/pipeline/nlp-pipeline
{
"acknowledged" : true
}
```
## Create an index for ingestion
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
In order to use the text embedding processor defined in your pipelines, create an index with mapping data that aligns with the maps specified in your pipeline. For example, the `output_fields` defined in the `field_map` field of your processor request must map to the k-NN vector fields with a dimension that matches the model. Similarly, the `text_fields` defined in your processor should map to the `text_fields` in your index.
### Example request
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
The following example request creates an index that attaches to a Neural Search pipeline. Because the index maps to k-NN vector fields, the index setting field `index-knn` is set to `true`. Furthermore, `mapping` settings use [k-NN method definitions](https://opensearch.org/docs/latest/search-plugins/knn/knn-index/#method-definitions) to match the maps defined in the Neural Search pipeline.
```json
PUT /my-nlp-index-1
{
"settings": {
"index.knn": true,
"default_pipeline": "<pipeline_name>"
},
"mappings": {
"properties": {
"passage_embedding": {
"type": "knn_vector",
"dimension": int,
"method": {
"name": "string",
"space_type": "string",
"engine": "string",
"parameters": json_object
}
},
"passage_text": {
"type": "text"
},
}
}
}
```
### Example response
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
OpenSearch responds with information about your new index:
```json
{
"acknowledged" : true,
"shards_acknowledged" : true,
"index" : "my-nlp-index-1"
}
```
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
## Ingest documents into Neural Search
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
Document ingestion is managed by OpenSearch's [Ingest API](https://opensearch.org/docs/latest/api-reference/ingest-apis/index/), similarly to other OpenSearch indexes. For example, you can ingest a document that contains the `passage_text: "Hello world"` with a simple POST method:
```json
POST /my-nlp-index-1/_doc
{
"passage_text": "Hello world"
}
```
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
With the text_embedding processor in place through a Neural Search pipeline, the example indexes "Hello world" as a `text_field` and converts "Hello world" into an associated k-NN vector field.
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
## Search a neural index
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
If you want to use a language model to convert a text query into a k-NN vector query, use the `neural` query fields in your query. The neural query request fields can be used in both the [Search API](https://opensearch.org/docs/latest/search-plugins/knn/api/#search-model) and [Query DSL](https://opensearch.org/docs/latest/opensearch/query-dsl/index/).
### Neural request fields
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
Include the following request fields under the `neural` field in your query:
Field | Data Type | Description
:--- | :--- | :---
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
vector_field | string | The vector field against which to run a search query.
query_text | string | The query text from which to produce queries.
model_id | string | The ID of the model that will be used in the embedding interface. The model must be indexed in OpenSearch before it can be used in Neural Search.
k | integer | The number of results the k-NN search returns.
### Example request
Editorial review for Model Framework and Neural Search (#1956) * Fix header in ML commons Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Remove redundant file Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Yaliang Wu <ylwu@amazon.com> * Add lines for easier editing Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/api.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add ML editorial feedback Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _ml-commons-plugin/model-serving-framework.md Co-authored-by: Nate Bower <nbower@amazon.com> * Add Neural Search section (#1882) * Add Neural Search section Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add getting started instructions Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add example responses to Neural Search Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add neural request fields Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add review tweaks Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Add forum link Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update _neural-search-plugin/index.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Update index.md * Fix second sentence Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Small typos in Neural Search (#1959) * Small typos in Neural Search * Update index.md * Update index.md * Update plugin documentation to reference the CAT API (#1962) * Update plugin documentation to reference the CAT API Signed-off-by: ariamarble <armarble@amazon.com> * made editorial changes Signed-off-by: ariamarble <armarble@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> * Add ML commons plugin Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Change model serving format Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Fix plugin cap Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Neural Search editorial Signed-off-by: Naarcha-AWS <naarcha@amazon.com> * Update index.md Incorporate Chris' feedback * Update model-serving-framework.md Signed-off-by: Naarcha-AWS <naarcha@amazon.com> Signed-off-by: ariamarble <armarble@amazon.com> Co-authored-by: Yaliang Wu <ylwu@amazon.com> Co-authored-by: Nate Bower <nbower@amazon.com> Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Aria Marble <111301581+ariamarble@users.noreply.github.com>
2022-11-17 14:42:24 -05:00
The following example request uses a search query that returns vectors for the "Hello World" query text:
```json
GET my_index/_search
{
"query": {
"bool" : {
"filter": {
"range": {
"distance": { "lte" : 20 }
}
},
"should" : [
{
"script_score": {
"query": {
"neural": {
"passage_vector": {
"query_text": "Hello world",
"model_id": "xzy76xswsd",
"k": 100
}
}
},
"script": {
"source": "_score * 1.5"
}
}
}
,
{
"script_score": {
"query": {
"match": { "passage_text": "Hello world" }
},
"script": {
"source": "_score * 1.7"
}
}
}
]
}
}
}
```