Documentation
¶
Overview ¶
Package fa derives word-level forced-alignment scores from per-character rows, using true durations recovered from the inter-character Silence (which restores the timing that CTC's peaky, one-frame-per-character spikes otherwise hide).
The primary error detector is the MINIMUM character score (empirically the strongest single signal): an alignment error collapses at least one character toward zero, while a merely-hard-but-correct word stays uniformly mediocre. TrimmedMinScore drops leading/trailing characters that look like spillover contamination from an adjacent word before taking the minimum.
Index ¶
Constants ¶
const SilInWord = 3
SilInWord marks an intra-word gap: part of the character's real duration.
Variables ¶
This section is empty.
Functions ¶
func GeometricMean ¶
GeometricMean is exp(mean(log(score))), the FA score of a word from its chars, and of a verse from its words, in both mms_align and qa_align. A score of 0 is taken as 1e-12. It returns 0 when there are no scores.
Types ¶
type FAChar ¶
type FAChar struct {
Char rune
BeginTS float64
EndTS float64
FAScore float64
Silence float64
SilenceLong int
IsASR bool // reserved; not used yet
}
FAChar mirrors your Char2, so filling it is a field-for-field copy.
type FAConfig ¶
type FAConfig struct {
StrongScore float64
RampDropFrac float64
MaxLeadingFrac float64
MinRampChars int
RequireShortLead bool
LeadShortDurSec float64
}
FAConfig holds tunable thresholds for edge-contamination detection.
func DefaultFAConfig ¶
func DefaultFAConfig() FAConfig