tagger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package tagger provides a Hidden Markov Model part-of-speech tagger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HMMTagger

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

HMMTagger implement a Hidden Markov Model (HMM) part-of-speech tagger.

func NewHMMTagger

func NewHMMTagger(model model.Model, wordHandler words.WordHandler,
	trigramModel trigrams.TrigramModel, beamFactor float64) HMMTagger

NewHMMTagger constructs a new tagger from the given data model, word handler and trigram model. The beam factor specifies how aggressively the search space should be pruned. For instance, a beam factor of 1000 will exclude all paths that are 1000 times less probable than the most probable path.

func (HMMTagger) Tag

func (t HMMTagger) Tag(sentence []string) Trellis

Tag tags a sentence.

type Trellis

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

A Trellis is used during HMM tagging to store possible analyses.

func (Trellis) Tags

func (t Trellis) Tags() ([]string, float64)

Tags returns the most likely part-of-speech tag sequence in the Trellis.

Jump to

Keyboard shortcuts

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