Package com.vivoka.vsdk.asr
Class DynamicModel
java.lang.Object
com.vivoka.vsdk.asr.DynamicModel
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a slot value to the model.voidAdds a slot value with custom phonetic transcriptions to the model.voidAdds a slot values to the model.voidClears all slots values from the model.voidClears the values of a specific slot.voidcompile()Compiles the model, preparing it for use after adding slot values.abstract voidCompiles the model, preparing it for use after adding slot values.getName()Get the name of the modelprotected abstract voidrelease()voidremoveData(String slotName, String value) Removes a slot value from the model.
-
Field Details
-
_name
-
_data
-
-
Constructor Details
-
DynamicModel
- Throws:
Exception
-
-
Method Details
-
getName
Get the name of the model- Returns:
- The name of the model.
-
addData
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
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
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
Clears the values of a specific slot.- Parameters:
slotName- The name of the slot.- Throws:
Exception- if the slot does not exist.
-
compile
Compiles the model, preparing it for use after adding slot values.- Throws:
Exception- If there is an error during compilation.
-
compile
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
- Throws:
Exception
-