lexvec

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 WithMinCount

func WithMinCount(v int) ModelOption

corpus options

func WithNegativeSampleSize

func WithNegativeSampleSize(v int) ModelOption

for lexvec options

func WithRelation

func WithRelation(typ RelationType) ModelOption

func WithSmooth

func WithSmooth(v float64) 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 Options

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

	NegativeSampleSize int
	RelationType       RelationType
	Smooth             float64
	SubsampleThreshold float64
	Theta              float64
}

type RelationType

type RelationType string
const (
	PPMI           RelationType = "ppmi"
	PMI            RelationType = "pmi"
	Collocation    RelationType = "co"
	LogCollocation RelationType = "logco"
)

func (*RelationType) Set

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

func (*RelationType) String

func (t *RelationType) String() string

func (*RelationType) Type

func (t *RelationType) Type() string

Jump to

Keyboard shortcuts

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