pos

package
v0.0.0-...-0d25092 Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: MIT Imports: 7 Imported by: 0

README

Run POS tagger prescision test

 make ONTONOTES_PATH=/home/user/ontonotes test-prescision

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDigit

func IsDigit(s string) bool

func StrPrefix

func StrPrefix(str string, sz int) string

func StrSuffix

func StrSuffix(str string, sz int) string

Types

type BaseTagger

type BaseTagger struct {
	Tokenizer tokenize.Tokenizer
}

type Callback

type Callback func(int, int)

callback func(current, total) for Train progress

type PerceptronTagger

type PerceptronTagger struct {
	FrequencyThreshold int
	AmbiguityThreshold float64
	START_TOK          []string
	END_TOK            []string
	ModelPath          string
	Model              *ml.AveragedPerceptron
	TagMap             map[string]string
	Classes            map[string]struct{}
	// contains filtered or unexported fields
}

func NewPerceptronTagger

func NewPerceptronTagger(config TaggerConfig) (*PerceptronTagger, error)

func (*PerceptronTagger) LoadModel

func (t *PerceptronTagger) LoadModel(filename string) error

func (*PerceptronTagger) SaveModel

func (t *PerceptronTagger) SaveModel() error

func (*PerceptronTagger) Tag

func (t *PerceptronTagger) Tag(sentence string) ([]*tokenize.Token, error)

func (*PerceptronTagger) Train

func (t *PerceptronTagger) Train(sentences []WordsTags, rounds int, progressFn Callback)

type PosTagger

type PosTagger interface {
	Tag(string) []tokenize.Token
}

type TaggerConfig

type TaggerConfig struct {
	Tokenizer tokenize.Tokenizer
	LoadModel bool
	ModelPath string
}

type WordsTags

type WordsTags struct {
	Words []string
	Tags  []string
}

Jump to

Keyboard shortcuts

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