KeywordRecognitionModel.fromStream(InputStream inputStream, String name, boolean isZipped) Method

Definition

Creates a keyword recognition model using the specified input stream.

public static KeywordRecognitionModel fromStream(InputStream inputStream, String name, boolean isZipped)

Parameters

inputStream
InputStream

A stream that represents data for the keyword recognition model. Note, the file can be a zip file in which case the model will be extracted from the zip.

name
String

The name of the keyword. Note: The name needs to be unique for different keywords as it will be used internally to match a particular keyword spotter model. In case you are updating the keyword with a new version, add a version tag to the name or otherwise the previous version will be overwritten on disk.

isZipped
boolean

If true, the input stream is treated as a zip. false, if the input is just the kws table file.

Returns

The keyword recognition model being created.

Exceptions

IllegalArgumentException

In case the kws.table file was not found or the temp directory could not be created.

IOException

If the name of the kws contains an illegal separator char, or in case the temp path and/or names are not valid.

Applies to