Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/classify"

Index

Functions

Functions

classify

  • classify(input: string, targets: TargetsMutableImmutable, classifier: Classifier): Promise<IContextImmutable>
  • This function converts a set of classification targets into a context for evaluation. This is especially useful for creating a context that can be used by a conditional link to determine where to move after a response has been received.

    example

    Parameters

    • input: string

      the response data from the user

    • targets: TargetsMutableImmutable

      the targets to evaluate

    • classifier: Classifier

      the classifer implementation to use to determine what the input matches with

    Returns Promise<IContextImmutable>

    a built up context of the form

    {
      "{type of target: (intent, meaning, etc)}": {
        "{name of target (camelCase)}": {
          "confidence": 0.576
        }
      }
    }