Options
All
  • Public
  • Public/Protected
  • All
Menu

An extension of featurizer that holds a value in its state.

abstract

Type parameters

  • Value

Hierarchy

Index

Constructors

constructor

  • new Slot(dependantActions: string[], invDependantActions: string[]): Slot
  • Parameters

    • dependantActions: string[]

      The list of actions that can be taken by the model only when the slot is defined.

    • invDependantActions: string[]

      The list of actions that can be taken by the model only when the slot is undefined.

    Returns Slot

Properties

Protected actions

actions: any[]

The list of every action the model can take.

Private dependantActions

dependantActions: string[]

The list of actions that can be taken by the model only when the slot is defined.

Readonly id

id: string

An ID used by models for exportations.

Private invDependantActions

invDependantActions: string[]

The list of actions that can be taken by the model only when the slot is undefined.

Readonly size

size: number = 1

The size of the vector returned by the featurizer. By default it's set to 1 which is the default for a featurizer that returns no features.

Private value

value: Value

Stores the value of the slot.

Methods

export

getActionMask

  • getActionMask(): boolean[]

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

getValue

  • getValue(): Value

handleAction

  • handleAction(action: any): void

handleQuery

  • handleQuery(query: string, data?: any): Promise<any>
  • Featurizes and handle a text query.

    remarks

    This method can directly return a 1D tensor to provide features to the model. Alternatively, it can returns data of any type if the Featurizer implement a custom getOptimizableFeatures method to handle those data. If this method doesn't return something, no features will be passed to the model.

    Parameters

    • query: string
    • Optional data: any

    Returns Promise<any>

init

  • init(actions: any[]): Promise<void>
  • Initialize the model, can be asynchronous async code.

    This method is executed by the model during it's initialization, it will also set the actions attribute.

    Parameters

    • actions: any[]

    Returns Promise<void>

load

resetDialog

  • resetDialog(): void

setValue

  • setValue(value: Value): void
  • Redefine a new value for the slot.

    Parameters

    • value: Value

    Returns void

Legend

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

Generated using TypeDoc