Documentation
¶
Index ¶
- Constants
- func OutputAudioFiles(ctx context.Context, files map[string]AudioFile) (string, *log.Status)
- func PadBegin(beginTS float64, prevEndTS float64, hasPrev bool) float64
- func PadEnd(endTS float64, nextBeginTS float64, hasNext bool) float64
- type AlignChar
- type AlignLine
- type AudioFile
- type Char
- type Char2
- type InputFile
- type LogicalKey
- type Pair
- type PairDiff
- type PairText
- type Publish
- type Verse2
- type VerseRef
- type Word2
Constants ¶
const AudioPadSec = 0.20
AudioPadSec is the context, in seconds, added on each side of the speech of every training and ASR sample, whether a verse or a phrase. It is limited to half the gap to the neighbouring sample in the same audio file, so that neighbouring samples never overlap. Verses and phrases use the same padding so that a model trained on phrases hears the same lead-in and tail-off as the verses that ASR is run on.
Variables ¶
This section is empty.
Functions ¶
func OutputAudioFiles ¶ added in v1.2.0
Types ¶
type AlignChar ¶
type AlignChar struct {
LineId int64
LineRef VerseRef // e.g. GEN 1:3-5a or GEN 1 or GEN 1:49-2:1
WordId int64 // WordSeq, Word could be added
Word string
WordPunct string
CharSeq int
Char rune
BeginTS float64
EndTS float64
FAScore float64
IsASR bool
Duration float64
Silence float64
SilencePos int
ScoreError int
SilenceLong int
}
type AudioFile ¶ added in v1.2.0
type Char2 ¶ added in v1.2.0
type Char2 struct {
Char rune `json:"char"`
BeginTS float64 `json:"begin_ts"` // Used in align_silence to compute silence
EndTS float64 `json:"end_ts"` // Used in align_silence to compute silence
FAScore float64 `json:"fa_score"` // The critical output from qa_align used to locate errors
Silence float64 `json:"-"` // Computed in align_silence
SilenceLong int `json:"-"`
IsASR bool `json:"-"`
}
Char2 is sourced from chars_qa_align, words_qa_align, and scripts_qa_align, the result of forced alignment using a model for the language, not MMS. qa_align adds each verse's chop offset (qa_align.go's FARequest.BeginTS) onto its timestamps before storing them, so they are chapter-absolute, the same frame as the timestamps in the other tables.
type InputFile ¶ added in v1.2.0
type InputFile struct {
MediaId string
MediaType request.MediaType
Testament string
BookId string // not used for text_plain
BookSeq string
Chapter int // only used for audio
ChapterEnd int
Verse string // not sure how this is used but parseV4AudioFilename parses it.
VerseEnd string
ScriptLine string
Filename string
FileExt string
Directory string
BaseURL string
}
type LogicalKey ¶
type Pair ¶ added in v1.2.0
type Pair struct {
Ref VerseRef `json:"ref"`
ScriptNum string `json:"script_num"`
AudioFile string `json:"audio_file"`
BeginTS float64 `json:"begin_ts"`
EndTS float64 `json:"end_ts"`
Base PairText `json:"base"`
Comp PairText `json:"comp"`
Text PairDiff `json:"text"`
Uroman PairDiff `json:"uroman"`
}
func (*Pair) LargestLength ¶ added in v1.2.0
LargestLength returns the longest run of contiguous non-equal chars: inserts, deletes and replaces next to each other, ended by any equal text. Spaces are not counted. A replace contributes the longer of its two sides.
func (*Pair) LargestLengthTest ¶ added in v1.2.0
LargestLengthTest returns the longest run of inserted/deleted chars. A single equal char between changes does not break the run, and is not counted.
type Publish ¶
type Publish struct {
BookId string
ChapterNum int
Page int
Paragraph int
Sentence int
// contains filtered or unexported fields
}
func NewPublish ¶
func (Publish) Description ¶
func (Publish) IsLogicalKey ¶
func (p Publish) IsLogicalKey()
type Verse2 ¶ added in v1.2.0
type Verse2 struct {
ScriptId int64 `json:"script_id"`
LineRef VerseRef `json:"verse_ref"`
ASRText string `json:"asr_transcript"` // Transcript
BeginTS float64 `json:"begin_ts"` // Start of the audio given to ASR and qa_align
EndTS float64 `json:"end_ts"` // End of the audio given to ASR and qa_align
PlayBeginTS float64 `json:"play_begin_ts"` // Used in report to play audio, see scripts.play_begin_ts
PlayEndTS float64 `json:"play_end_ts"` // Used in report to play audio
Duration float64 `json:"duration"` // Displayed in audio
Words []Word2 `json:"words"`
}
func (Verse2) PlayTimes ¶ added in v1.2.0
PlayTimes returns the audio a report plays for this verse. A database aligned before the play times existed has none, and then plays the verse's ASR audio.
type VerseRef ¶
type VerseRef struct {
BookId string `json:"book_id"`
ChapterNum int `json:"chapter_num"`
VerseStr string `json:"verse_str"`
ChapterEnd int `json:"chapter_end"`
VerseEnd string `json:"verse_end"`
}
func NewVerseRef ¶
func (VerseRef) Description ¶
func (VerseRef) IsLogicalKey ¶
func (r VerseRef) IsLogicalKey()
type Word2 ¶ added in v1.2.0
type Word2 struct {
WordId int64 `json:"word_id"`
Chars []Char2 `json:"chars"`
Text string `json:"word"` // Word text with no punctuation
WordPunct string `json:"word_punct"` // Word with punctuation added back
Uroman string `json:"uroman"`
BeginTS float64 `json:"begin_ts"` // Used in report for word Karoke highlighting
EndTS float64 `json:"end_ts"` // Used in report for word Karoke highlighting
FAScore float64 `json:"fa_score"` // Computed in align_compare
IsASR bool `json:"-"`
Opacity float64 `json:"-"`
}