pub struct DatasetSample {
pub id: String,
pub text: String,
pub audio: AudioData,
pub speaker: Option<SpeakerInfo>,
pub language: LanguageCode,
pub quality: QualityMetrics,
pub phonemes: Option<Vec<Phoneme>>,
pub metadata: HashMap<String, Value>,
}Expand description
Dataset sample with comprehensive metadata
Fields§
§id: StringUnique identifier for this sample
text: StringOriginal text
audio: AudioDataAudio data
speaker: Option<SpeakerInfo>Speaker information (if available)
language: LanguageCodeLanguage of the text
quality: QualityMetricsQuality metrics
phonemes: Option<Vec<Phoneme>>Phoneme sequence (if available)
metadata: HashMap<String, Value>Additional metadata
Implementations§
Source§impl DatasetSample
impl DatasetSample
Sourcepub fn new(
id: String,
text: String,
audio: AudioData,
language: LanguageCode,
) -> Self
pub fn new( id: String, text: String, audio: AudioData, language: LanguageCode, ) -> Self
Create new dataset sample
Sourcepub fn with_phonemes(self, phonemes: Vec<Phoneme>) -> Self
pub fn with_phonemes(self, phonemes: Vec<Phoneme>) -> Self
Set phonemes
Sourcepub fn with_speaker(self, speaker: SpeakerInfo) -> Self
pub fn with_speaker(self, speaker: SpeakerInfo) -> Self
Set speaker information
Sourcepub fn with_quality(self, quality: QualityMetrics) -> Self
pub fn with_quality(self, quality: QualityMetrics) -> Self
Set quality metrics
Sourcepub fn with_metadata(self, key: String, value: Value) -> Self
pub fn with_metadata(self, key: String, value: Value) -> Self
Add metadata
Sourcepub fn speaker_id(&self) -> Option<&str>
pub fn speaker_id(&self) -> Option<&str>
Get speaker ID (for backward compatibility)
Trait Implementations§
Source§impl AsRef<DatasetSample> for DatasetSample
impl AsRef<DatasetSample> for DatasetSample
Source§fn as_ref(&self) -> &DatasetSample
fn as_ref(&self) -> &DatasetSample
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for DatasetSample
impl Clone for DatasetSample
Source§fn clone(&self) -> DatasetSample
fn clone(&self) -> DatasetSample
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DatasetSample for DatasetSample
impl DatasetSample for DatasetSample
Source§fn speaker_id(&self) -> Option<&str>
fn speaker_id(&self) -> Option<&str>
Get the sample’s speaker ID (if available)
Source§impl Debug for DatasetSample
impl Debug for DatasetSample
Source§impl<'de> Deserialize<'de> for DatasetSample
impl<'de> Deserialize<'de> for DatasetSample
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DatasetSample
impl RefUnwindSafe for DatasetSample
impl Send for DatasetSample
impl Sync for DatasetSample
impl Unpin for DatasetSample
impl UnwindSafe for DatasetSample
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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