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

Safe HaskellNone

Data.CRF.Chain2.Pair

Synopsis

Documentation

data CRF a b c Source

Constructors

CRF 

Fields

codec :: Codec a b c
 
model :: Model Ob Lb Feat
 

Instances

(Ord a, Ord b, Ord c, Binary a, Binary b, Binary c) => Binary (CRF a b c) 

trainSource

Arguments

:: (Ord a, Ord b, Ord c) 
=> SgdArgs

Args for SGD

-> IO [SentL a (b, c)]

Training data IO action

-> Maybe (IO [SentL a (b, c)])

Maybe evalation data

-> IO (CRF a b c)

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.

tag :: (Ord a, Ord b, Ord c) => CRF a b c -> Sent a (b, c) -> [(b, c)]Source

Find the most probable label sequence.