speech_to_text

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

Generated by cmd/operatable DO NOT EDIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSamplesMessage

func NewSamplesMessage(from astibob.Identifier, samples []int, bitDepth, numChannels, sampleRate int, maxSilenceLevel float64) worker.Message

Types

type BuildOptions

type BuildOptions struct {
	StoreNewSpeeches bool `json:"store_new_speeches"`
}

type BuildReferences

type BuildReferences struct {
	Options  BuildOptions `json:"options"`
	Speeches []Speech     `json:"speeches"`
}

type Listenable

type Listenable struct {
	// contains filtered or unexported fields
}

func NewListenable

func NewListenable(o ListenableOptions) *Listenable

func (*Listenable) MessageNames

func (l *Listenable) MessageNames() (ns []string)

func (*Listenable) OnMessage

func (l *Listenable) OnMessage(m *astibob.Message) (err error)

type ListenableOptions

type ListenableOptions struct {
	OnText func(from astibob.Identifier, text string) error
}

type Parser

type Parser interface {
	Parse(samples []int, bitDepth, numChannels, sampleRate int) (string, error)
	Train(ctx context.Context, speeches []SpeechFile, progressFunc func(Progress))
}

type Progress

type Progress struct {
	CurrentStep string   `json:"current_step"`
	Error       error    `json:"-"`
	Progress    float64  `json:"progress"` // In percentage
	Steps       []string `json:"steps"`
}

type ProgressJSON

type ProgressJSON struct {
	Progress
	Error string `json:"error,omitempty"`
}

type Runnable

type Runnable struct {
	*astibob.BaseOperatable
	*astibob.BaseRunnable
	// contains filtered or unexported fields
}

func NewRunnable

func NewRunnable(name string, p Parser, l astikit.StdLogger, o RunnableOptions) *Runnable

func (*Runnable) Close

func (r *Runnable) Close()

func (*Runnable) Init

func (r *Runnable) Init() (err error)

type RunnableOptions

type RunnableOptions struct {
	SpeechesDirPath  string `toml:"speeches_dir_path"`
	StoreNewSpeeches bool   `toml:"store_new_speeches"`
}

type Samples

type Samples struct {
	BitDepth        int                `json:"bit_depth"`
	From            astibob.Identifier `json:"from"`
	MaxSilenceLevel float64            `json:"max_silence_level"`
	NumChannels     int                `json:"num_channels"`
	SampleRate      int                `json:"sample_rate"`
	Samples         []int              `json:"samples"`
}

type Speech

type Speech struct {
	CreatedAt   time.Time `json:"created_at"`
	IsValidated bool      `json:"is_validated"`
	Name        string    `json:"name"`
	Text        string    `json:"text"`
}

type SpeechFile

type SpeechFile struct {
	Path string `json:"path"`
	Text string `json:"text"`
}

type Text

type Text struct {
	From astibob.Identifier `json:"from"`
	Text string             `json:"text"`
}

type TrainReferences

type TrainReferences struct {
	Progress *ProgressJSON `json:"progress,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL