pub struct SpeechCommandsDataset { /* private fields */ }Available on crate features
std and dataset and audio only.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§
Source§impl SpeechCommandsDataset
impl SpeechCommandsDataset
Sourcepub fn new(split: &str) -> SpeechCommandsDataset
pub fn new(split: &str) -> SpeechCommandsDataset
Create a new dataset with the given split.
Sourcepub fn train() -> SpeechCommandsDataset
pub fn train() -> SpeechCommandsDataset
Create a new dataset with the train split.
Sourcepub fn test() -> SpeechCommandsDataset
pub fn test() -> SpeechCommandsDataset
Create a new dataset with the test split.
Sourcepub fn validation() -> SpeechCommandsDataset
pub fn validation() -> SpeechCommandsDataset
Create a new dataset with the validation split.
Sourcepub fn num_classes() -> usize
pub fn num_classes() -> usize
Returns the number of classes in the dataset
Trait Implementations§
Source§impl Dataset<SpeechItem> for SpeechCommandsDataset
impl Dataset<SpeechItem> for SpeechCommandsDataset
Auto Trait Implementations§
impl Freeze for SpeechCommandsDataset
impl !RefUnwindSafe for SpeechCommandsDataset
impl Send for SpeechCommandsDataset
impl Sync for SpeechCommandsDataset
impl Unpin for SpeechCommandsDataset
impl !UnwindSafe 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
Source§impl<I, T> Windows<I> for Twhere
T: Dataset<I>,
impl<I, T> Windows<I> for Twhere
T: Dataset<I>,
Source§fn windows(&self, size: usize) -> WindowsIterator<'_, I> ⓘ
fn windows(&self, size: usize) -> WindowsIterator<'_, I> ⓘ
Is empty if the Dataset is shorter than size.
§Panics
Panics if size is 0.
§Examples
use crate::burn_dataset::{
transform::{Windows, WindowsDataset},
Dataset, InMemDataset,
};
let items = [1, 2, 3, 4].to_vec();
let dataset = InMemDataset::new(items.clone());
for window in dataset.windows(2) {
// do sth with window
}