-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tyler Ohlsen <[email protected]> (cherry picked from commit 4d5f50c)
- Loading branch information
1 parent
fc29edf
commit 0bcb09f
Showing
23 changed files
with
576 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
export * from './interfaces'; | ||
export * from './transformer'; | ||
export * from './indexer'; | ||
export * from './other'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { COMPONENT_CATEGORY, COMPONENT_CLASS } from '../../utils'; | ||
import { BaseComponent } from '../base_component'; | ||
|
||
/** | ||
* A basic Document placeholder UI component. | ||
* Does not have any functionality. | ||
*/ | ||
export class Document extends BaseComponent { | ||
constructor() { | ||
super(); | ||
this.type = COMPONENT_CLASS.DOCUMENT; | ||
this.label = 'Document'; | ||
this.description = 'A document to be ingested'; | ||
this.categories = [COMPONENT_CATEGORY.INGEST]; | ||
this.allowsCreation = false; | ||
this.baseClasses = [this.type]; | ||
this.inputs = []; | ||
this.outputs = [ | ||
{ | ||
label: this.label, | ||
baseClasses: this.baseClasses, | ||
}, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './document'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
public/component_types/transformer/sparse_encoder_transformer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { COMPONENT_CATEGORY, COMPONENT_CLASS } from '../../../common'; | ||
import { MLTransformer } from '.'; | ||
|
||
/** | ||
* A specialized sparse encoder ML transformer UI component | ||
*/ | ||
export class SparseEncoderTransformer extends MLTransformer { | ||
constructor() { | ||
super(); | ||
this.type = COMPONENT_CLASS.SPARSE_ENCODER_TRANSFORMER; | ||
this.label = 'Sparse Encoder'; | ||
this.description = | ||
'A specialized ML transformer to perform sparse encoding'; | ||
this.categories = [COMPONENT_CATEGORY.INGEST]; | ||
this.baseClasses = [...this.baseClasses, this.type]; | ||
this.inputs = [ | ||
{ | ||
id: 'document', | ||
label: 'Document', | ||
baseClass: COMPONENT_CLASS.DOCUMENT, | ||
acceptMultiple: false, | ||
}, | ||
]; | ||
this.createFields = [ | ||
{ | ||
label: 'Sparse Encoding Model', | ||
id: 'model', | ||
type: 'model', | ||
helpText: | ||
'A sparse encoding model to be used for generating sparse vectors.', | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ml-commons-plugin/integrating-ml-models/#choosing-a-model', | ||
}, | ||
{ | ||
label: 'Input Field', | ||
id: 'inputField', | ||
type: 'string', | ||
helpText: | ||
'The name of the document field from which to obtain text for generating sparse embeddings.', | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ingest-pipelines/processors/sparse-encoding/#configuration-parameters', | ||
}, | ||
{ | ||
label: 'Vector Field', | ||
id: 'vectorField', | ||
type: 'string', | ||
helpText: `The name of the document's vector field in which to store the generated sparse embeddings.`, | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ingest-pipelines/processors/sparse-encoding/#configuration-parameters', | ||
}, | ||
]; | ||
this.outputs = [ | ||
{ | ||
label: 'Transformed Document', | ||
baseClasses: [COMPONENT_CLASS.DOCUMENT], | ||
}, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.