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

Safe HaskellNone
LanguageHaskell98

Data.CRF.Chain2.Tiers.Feature

Contents

Synopsis

Feature

data Feat Source

Feature; every feature is associated to a layer with ln identifier.

Constructors

TFeat3

Second-order transition feature.

Fields

x1 :: !Lb
 
x2 :: !Lb
 
x3 :: !Lb
 
ln :: !Int
 
TFeat2

First-order transition feature.

Fields

x1 :: !Lb
 
x2 :: !Lb
 
ln :: !Int
 
TFeat1

Zero-order transition feature.

Fields

x1 :: !Lb
 
ln :: !Int
 
OFeat

Observation feature.

Fields

ob :: !Ob
 
x1 :: !Lb
 
ln :: !Int
 

Instances

Feature generation

obFeats :: Ob -> Cb -> [Feat] Source

Generate observation features.

trFeats1 :: Cb -> [Feat] Source

Generate zero-order transition features.

trFeats2 :: Cb -> Cb -> [Feat] Source

Generate first-order transition features.

trFeats3 :: Cb -> Cb -> Cb -> [Feat] Source

Generate second-order transition features.

Feature extraction

presentFeats :: Xs -> Ys -> [(Feat, LogFloat)] Source

Features present in the dataset element together with corresponding occurence probabilities.

hiddenFeats :: Xs -> [Feat] Source

Features hidden in the dataset element.

obFeatsOn :: Xs -> Int -> CbIx -> [Feat] Source

Observation features on a given position and with respect to a given label (determined by idenex).

trFeatsOn :: Xs -> Int -> CbIx -> CbIx -> CbIx -> [Feat] Source

Transition features on a given position and with respect to a given labels (determined by indexes).

Feature selection

type FeatSel = Xs -> Ys -> [Feat] Source

A feature selection function type.

selectPresent :: FeatSel Source

The presentFeats adapted to fit feature selection specs.

selectHidden :: FeatSel Source

The hiddenFeats adapted to fit feature selection specs.