word2vec

package
v0.0.0-...-382d658 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadForCmd

func LoadForCmd(cmd *cobra.Command, opts *Options)

func New

func New(opts ...ModelOption) (model.Model, error)

func NewForOptions

func NewForOptions(opts Options) (model.Model, error)

Types

type ModelOption

type ModelOption func(*Options)

func ToLower

func ToLower() ModelOption

func Verbose

func Verbose() ModelOption

func WithBatchSize

func WithBatchSize(v int) ModelOption

model options

func WithDimension

func WithDimension(v int) ModelOption

func WithInitLearningRate

func WithInitLearningRate(v float64) ModelOption

func WithIteration

func WithIteration(v int) ModelOption

func WithMaxDepth

func WithMaxDepth(v int) ModelOption

word2vec options

func WithMinCount

func WithMinCount(v int) ModelOption

corpus options

func WithModel

func WithModel(typ ModelType) ModelOption

func WithNegativeSampleSize

func WithNegativeSampleSize(v int) ModelOption

func WithOptimizer

func WithOptimizer(typ OptimizerType) ModelOption

func WithSubsampleThreshold

func WithSubsampleThreshold(v float64) ModelOption

func WithTheta

func WithTheta(v float64) ModelOption

func WithThreadSize

func WithThreadSize(v int) ModelOption

func WithWindow

func WithWindow(v int) ModelOption

type ModelType

type ModelType string
const (
	Cbow     ModelType = "cbow"
	SkipGram ModelType = "skipgram"
)

func (*ModelType) Set

func (t *ModelType) Set(name string) error

func (*ModelType) String

func (t *ModelType) String() string

func (*ModelType) Type

func (t *ModelType) Type() string

type OptimizerType

type OptimizerType string
const (
	NegativeSampling    OptimizerType = "ns"
	HierarchicalSoftmax OptimizerType = "hs"
)

func (*OptimizerType) Set

func (t *OptimizerType) Set(name string) error

func (*OptimizerType) String

func (t *OptimizerType) String() string

func (*OptimizerType) Type

func (t *OptimizerType) Type() string

type Options

type Options struct {
	CorpusOptions corpus.Options
	ModelOptions  model.Options

	MaxDepth           int
	ModelType          ModelType
	NegativeSampleSize int
	OptimizerType      OptimizerType
	SubsampleThreshold float64
	Theta              float64
}

Jump to

Keyboard shortcuts

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