crf-chain2-generic-0.3.0: Second-order, generic, constrained, linear conditional random fields

Safe HaskellNone

Data.CRF.Chain2.Generic.Train

Synopsis

Documentation

data CodecSpec a b c o t Source

A codec specification.

Constructors

CodecSpec 

Fields

mkCodec :: [SentL a b] -> (c, [(Xs o t, Ys t)])
 
encode :: c -> [SentL a b] -> [(Xs o t, Ys t)]
 

trainSource

Arguments

:: (Ord a, Ord b, Eq t, Ord f, FeatMap m f) 
=> SgdArgs

Args for SGD

-> CodecSpec a b c o t

Codec specification

-> FeatGen o t f

Feature generation

-> FeatSel o t f

Feature selection

-> IO [SentL a b]

Training data IO action

-> Maybe (IO [SentL a b])

Maybe evalation data

-> IO (c, Model m o t f)

Resulting codec and model

Train the CRF using the stochastic gradient descent method. When the evaluation data IO action is Just, the iterative training process will notify the user about the current accuracy on the evaluation part every full iteration over the training part. TODO: Add custom feature extraction function.