Struct SpeechCommandsDataset
pub struct SpeechCommandsDataset { /* private fields */ }Expand description
Speech Commands dataset from Huggingface v0.02. See Speech Commands dataset.
The data is downloaded from Huggingface and stored in a SQLite database (3.0 GB). The dataset contains 99,720 audio samples of 2,607 people saying 35 different words.
NOTE: The most samples are under 1 second long but there are some with pure background noise that need splitting into shorter segmants.
The labels are 20 target words, silence and other words.
The dataset is split into 3 parts:
- train: 84,848 audio files
- test: 4,890 audio files
- validation: 9,982 audio files
Implementations§
§impl SpeechCommandsDataset
impl SpeechCommandsDataset
pub fn new(split: &str) -> SpeechCommandsDataset
pub fn new(split: &str) -> SpeechCommandsDataset
Create a new dataset with the given split.
pub fn train() -> SpeechCommandsDataset
pub fn train() -> SpeechCommandsDataset
Create a new dataset with the train split.
pub fn test() -> SpeechCommandsDataset
pub fn test() -> SpeechCommandsDataset
Create a new dataset with the test split.
pub fn validation() -> SpeechCommandsDataset
pub fn validation() -> SpeechCommandsDataset
Create a new dataset with the validation split.
pub fn num_classes() -> usize
pub fn num_classes() -> usize
Returns the number of classes in the dataset
Trait Implementations§
§impl Dataset<SpeechItem, SqliteDatasetError> for SpeechCommandsDataset
impl Dataset<SpeechItem, SqliteDatasetError> for SpeechCommandsDataset
§fn get(&self, index: usize) -> Result<SpeechItem, SqliteDatasetError>
fn get(&self, index: usize) -> Result<SpeechItem, SqliteDatasetError>
Gets the item at the given index. Read more
§fn get_many(&self, indexes: Vec<usize>) -> Result<Vec<I>, E>
fn get_many(&self, indexes: Vec<usize>) -> Result<Vec<I>, E>
Gets the items at given indexes Read more
§fn iter(&self) -> DatasetIterator<'_, I, E> ⓘwhere
Self: Sized,
fn iter(&self) -> DatasetIterator<'_, I, E> ⓘwhere
Self: Sized,
Returns an iterator over the dataset.
Auto Trait Implementations§
impl !RefUnwindSafe for SpeechCommandsDataset
impl !UnwindSafe for SpeechCommandsDataset
impl Freeze for SpeechCommandsDataset
impl Send for SpeechCommandsDataset
impl Sync for SpeechCommandsDataset
impl Unpin for SpeechCommandsDataset
impl UnsafeUnpin for SpeechCommandsDataset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more