Options
All
  • Public
  • Public/Protected
  • All
Menu

Featurizes queries using the Universal Sentence Encoder model.

Hierarchy

Index

Properties

Protected actions

actions: any[]

The list of every action the model can take.

Private emptyEncoding

emptyEncoding: tf.Tensor1D

Private encoder

encoder: UniversalSentenceEncoder

Readonly id

id: "Universal Sentence Encoder" = "Universal Sentence Encoder"

Readonly size

size: 512 = 512

Methods

Private encodeQuery

  • encodeQuery(query: string): Promise<tf.Tensor1D>
  • Encodes a query using the model.

    Parameters

    • query: string

    Returns Promise<tf.Tensor1D>

export

getActionMask

  • getActionMask(): boolean[]
  • Produce an action mask according to featurizer state. (Generally, this method is reimplemented in stateful featurizers)

    Returns boolean[]

    An array of boolean mapping every actions availability.

getOptimizableFeatures

  • getOptimizableFeatures(data: any): tf.Tensor1D
  • Turn the data returned by handleQuery into an embedding vector. This function is used to expose featurizer variables to the model optimizer for training.

    Reimplementing this method is not necessary if your featurizer is not meant to be optimizable through gradient descent. In this case, just return the feature vector directly using the handleQuery method.

    remarks

    It's important to keep this function stateless, it should only depend of its tensor argument and of featurizer's variables.

    Parameters

    • data: any

    Returns tf.Tensor1D

handleAction

  • handleAction(action: any): void

handleQuery

  • handleQuery(query: string): Promise<tf.Tensor1D>

init

  • init(actions: any[]): Promise<void>

load

resetDialog

  • resetDialog(): void

Legend

  • Class
  • Class with type parameter
  • Property
  • Method
  • Function
  • Type alias
  • Private property
  • Private method
  • Enumeration
  • Interface
  • Inherited method

Generated using TypeDoc