Struct deepspeech::Model [−][src]
pub struct Model { /* fields omitted */ }
Methods
impl Model
[src]
impl Model
pub fn load_from_files(
model_path: &Path,
n_cep: u16,
n_context: u16,
alphabet_path: &Path,
beam_width: u16
) -> Result<Self, ()>
[src]
pub fn load_from_files(
model_path: &Path,
n_cep: u16,
n_context: u16,
alphabet_path: &Path,
beam_width: u16
) -> Result<Self, ()>
Load a DeepSpeech model from the specified model and alphabet file paths
pub fn enable_decoder_with_lm(
&mut self,
alphabet_path: &Path,
language_model_path: &Path,
trie_path: &Path,
weight: f32,
valid_word_count_weight: f32
)
[src]
pub fn enable_decoder_with_lm(
&mut self,
alphabet_path: &Path,
language_model_path: &Path,
trie_path: &Path,
weight: f32,
valid_word_count_weight: f32
)
Load a KenLM language model from a file and enable decoding using beam scoring
pub fn speech_to_text(
&mut self,
buffer: &[i16],
sample_rate: u32
) -> Result<String, FromUtf8Error>
[src]
pub fn speech_to_text(
&mut self,
buffer: &[i16],
sample_rate: u32
) -> Result<String, FromUtf8Error>
Perform speech-to-text using the model
The input buffer must consist of mono 16-bit samples. The sample rate is not freely chooseable but a property of the model files.
pub fn setup_stream(
&mut self,
pre_alloc_frames: u32,
sample_rate: u32
) -> Result<Stream, ()>
[src]
pub fn setup_stream(
&mut self,
pre_alloc_frames: u32,
sample_rate: u32
) -> Result<Stream, ()>
Set up a state for streaming inference