Options
All
  • Public
  • Public/Protected
  • All
Menu

Text Embedding with Tensorflow Universal Sentence Encoder (USE)

implements

{TensorScriptModelInterface}

Hierarchy

Index

Constructors

constructor

Properties

compiled

compiled: boolean

getInputShape

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

Type declaration

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

      • Rest ...args: any[]

      Returns any

Optional getTimeseriesShape

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

Type declaration

Optional layers

model

model: any

reshape

reshape: (...args: any[]) => any

Type declaration

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

      • Rest ...args: any[]

      Returns any

settings

tf

tf: any

tokenizer

tokenizer: any

trained

trained: boolean

type

type: string

Optional xShape

xShape: number[]

Optional yShape

yShape: number[]

Methods

calculate

  • Calculates sentence embeddings

    override

    Parameters

    • input_array: InputTextArray

      new test independent variables

    • Default value options: {} = {}

      model prediction options

    Returns any

    returns tensorflow prediction

exportConfiguration

importConfiguration

loadModel

  • loadModel(options: string): Promise<any>

predict

saveModel

  • saveModel(options: string): Promise<any>

train

  • train(): Promise<any>
  • Asynchronously loads Universal Sentence Encoder and tokenizer

    override

    Returns Promise<any>

    returns loaded UniversalSentenceEncoder model

Static getInputShape

  • getInputShape(matrix?: any): Shape

Static reshape

  • Reshapes an array

    function
    example

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

    Parameters

    Returns Matrix | Vector

    returns a matrix with the defined shape