sequor-0.7.2: A sequence labeler based on Collins's sequence perceptron.

Safe HaskellNone




data Config Source


type Token = [Text]Source

Token is a representation of a word, which consists of a number of fields.

type Label = TextSource

Label is a label associated to a token.

type Sentence = [Token]Source

Sentence is a sequence of tokens.

train :: Flags -> Feature -> [(Sentence, [Label])] -> [(Sentence, [Label])] -> (ModelData, Trace)Source

train flags template training development trains a model on training sentences using give flags and feature template and returns the model and a for each iteration the error rate on training and development sentences.

predict :: ModelData -> [[Token]] -> [[Label]]Source

predict model sentence returns the best label sequence for sentence. A sentence is a sequence of Tokens.

parseTemplate :: Text -> FeatureSource

parseTemplete s parses feature template in s and returns the result.