Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextEmbedding

Text Embedding with Tensorflow Universal Sentence Encoder (USE)

implements

{TensorScriptModelInterface}

Hierarchy

Index

Constructors

  • new TextEmbedding(options?: TensorScriptOptions, properties?: TensorScriptProperties): TextEmbedding

Properties

compiled: boolean
getInputShape: (...args: any[]) => any

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

getTimeseriesShape?: (x_timeseries: undefined | NestedArray<any>) => Shape

Type declaration

    • (x_timeseries: undefined | NestedArray<any>): Shape
    • Parameters

      • x_timeseries: undefined | NestedArray<any>

      Returns Shape

layers?: TensorScriptLayers | TensorScriptSavedLayers
loss?: number
model: any
reshape: (...args: any[]) => any

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

settings: TensorScriptOptions
tf: any
tokenizer: any
trained: boolean
type: string
xShape?: number[]
yShape?: number[]

Methods

  • calculate(input_array: InputTextArray, options?: {}): any
  • exportConfiguration(): TensorScriptContext
  • importConfiguration(configuration: TensorScriptContext): void
  • loadModel(options: string): Promise<any>
  • predict(input_array: InputTextArray, options?: PredictionOptions): Promise<Vector | Matrix>
  • saveModel(options: string): Promise<any>
  • train(): Promise<any>
  • getInputShape(matrix?: any): Shape
  • reshape(array: Vector, shape: Shape): Vector | Matrix
  • Reshapes an array

    function
    example

    const array = [ 0, 1, 1, 0, ]; const shape = [2,2]; TensorScriptModelInterface.reshape(array,shape) // => [ [ 0, 1, ], [ 1, 0, ], ];

    Parameters

    • array: Vector

      input array

    • shape: Shape

      shape array

    Returns Vector | Matrix

    returns a matrix with the defined shape