nlu.annotation.slot_annotator

This file contains a class which can be used to annotate slot values in the user utterance.

Module Contents

Classes

SlotAnnotator

This class is used to annotate slot values in the user utterance.

class nlu.annotation.slot_annotator.SlotAnnotator

Bases: abc.ABC

This class is used to annotate slot values in the user utterance.

abstract slot_annotation(slot: moviebot.nlu.annotation.slots.Slots, utterance: moviebot.core.utterance.utterance.UserUtterance) List[moviebot.nlu.annotation.item_constraint.ItemConstraint]

Given utterance and a slot return a list of triplets of (slot, operator, value).

IMPORTANT: This will be changed to return semantic annotations instead!

Parameters:
  • slot (Slots) – Slot for which to annotate

  • utterance (UserUtterance) – User utterance class which contains both original utterance and utterance tokens.

Raises:

NotImplementedError – Must be overridden

Returns:

List of constraints

Return type:

List[ItemConstraint]