phonemizer_multi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sample

type Sample struct {
	Sentence []Token
}

Sample is one sentence

func NewDataset

func NewDataset(dir string) (ret []Sample)

func (*Sample) V1

func (s *Sample) V1(dim, pos int) SampleSentence

func (*Sample) V2 added in v0.2.0

func (s *Sample) V2(dim, pos int) SampleSentence

type SampleSentence

type SampleSentence struct {
	Sample *Sample
	// contains filtered or unexported fields
}

func (*SampleSentence) IO

func (s *SampleSentence) IO(n int) (ret *SampleSentenceIO)

func (*SampleSentence) Len

func (s *SampleSentence) Len() int

type SampleSentenceIO

type SampleSentenceIO struct {
	SampleSentence *SampleSentence
	// contains filtered or unexported fields
}

func (*SampleSentenceIO) Feature

func (s *SampleSentenceIO) Feature(n int) (ret uint32)

Feature: calculates query, key, value input for attention matrix n - if dividible by 3, it's supposed to return the homograph n - if equal to 1 divided by 3, it calculates the key token n - if equal to 2 divided by 3, it calculates the value token

func (*SampleSentenceIO) Output

func (s *SampleSentenceIO) Output() (ret uint16)

func (*SampleSentenceIO) Parity

func (s *SampleSentenceIO) Parity() (ret uint16)

type Token

type Token struct {
	// homograph = hash of written word == query
	Homograph uint32
	// solution = hash of ipa word == value
	Solution uint32
	// here the fisrt integer is like solution (hash of ipa word), the second is the tag key
	Choices [][2]uint32
}

func (*Token) Len

func (t *Token) Len() int

Jump to

Keyboard shortcuts

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