crf-chain2-tiers-0.1.1: Second-order, tiered, constrained, linear conditional random fields

Safe HaskellNone

Data.CRF.Chain2.Tiers

Contents

Synopsis

CRF

data CRF a b Source

CRF model data.

Constructors

CRF 

Fields

numOfLayers :: Int
 
codec :: Codec a b
 
model :: Model
 

Instances

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

size :: CRF a b -> IntSource

Compute size (number of features) of the model.

prune :: Double -> CRF a b -> CRF a bSource

Discard model features with absolute values (in log-domain) lower than the given threshold.

Training

trainSource

Arguments

:: (Ord a, Ord b) 
=> Int

Number of layers (tiers)

-> FeatSel

Feature selection

-> SgdArgs

SGD parameters

-> Bool

Store dataset on a disk

-> IO [SentL a b]

Training data IO action

-> IO [SentL a b]

Evaluation data

-> IO (CRF a b)

Resulting model

Train the CRF using the stochastic gradient descent method.

reTrainSource

Arguments

:: (Ord a, Ord b) 
=> CRF a b

Existing CRF model

-> SgdArgs

SGD parameters

-> Bool

Store dataset on a disk

-> IO [SentL a b]

Training data IO action

-> IO [SentL a b]

Evaluation data

-> IO (CRF a b)

Resulting model

Re-train the CRF using the stochastic gradient descent method.

Tagging

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

Find the most probable label sequence.

Modules