Class DynamicModel

java.lang.Object
com.vivoka.vsdk.asr.DynamicModel

public abstract class DynamicModel extends Object
Abstract class representing a dynamic model for speech recognition. It allows adding, removing, and managing data associated with different slots. Subclasses must implement the configure, compile, and destroy methods.
  • Field Details

  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Get the name of the model
      Returns:
      The name of the model.
    • addData

      public void addData(String slotName, ArrayList<String> values) throws Exception
      Adds a slot values to the model.
      Parameters:
      slotName - The name of the slot.
      values - The values to add to the slot.
      Throws:
      Exception - If the slot does not exist.
    • addData

      public void addData(String slotName, String value) throws Exception
      Adds a slot value to the model.
      Parameters:
      slotName - The name of the slot.
      value - The value to add to the slot.
      Throws:
      Exception - If the slot does not exist.
    • addData

      public void addData(String slotName, String value, ArrayList<String> phoneticTranscriptions) throws Exception
      Adds a slot value with custom phonetic transcriptions to the model. The phonetic transcriptions can be null or an empty list.
      Parameters:
      slotName - The name of the slot.
      value - The value to add to the slot.
      phoneticTranscriptions - The phonetic transcriptions for the value.
      Throws:
      Exception - If the slot does not exist.
    • removeData

      public void removeData(String slotName, String value) throws Exception
      Removes a slot value from the model.
      Parameters:
      slotName - The name of the slot.
      value - The value to remove from the slot.
      Throws:
      Exception - if the slot or value does not exist.
    • clearAllSlots

      public void clearAllSlots()
      Clears all slots values from the model.
    • clearSlot

      public void clearSlot(String slotName) throws Exception
      Clears the values of a specific slot.
      Parameters:
      slotName - The name of the slot.
      Throws:
      Exception - if the slot does not exist.
    • compile

      public void compile() throws Exception
      Compiles the model, preparing it for use after adding slot values.
      Throws:
      Exception - If there is an error during compilation.
    • compile

      public abstract void compile(String user) throws Exception
      Compiles the model, preparing it for use after adding slot values.
      Parameters:
      user - the model will use the supported user words.
      Throws:
      Exception - If there is an error during compilation.
    • release

      protected abstract void release() throws Exception
      Throws:
      Exception