concraft-0.3.0: Morphosyntactic tagging tool based on constrained CRFs

Safe HaskellNone

NLP.Concraft.Disamb.Tiered

Contents

Synopsis

Tiered model

newtype Ob Source

Observation.

Constructors

Ob 

Fields

unOb :: Int
 

Instances

newtype Lb Source

Sub
label.

Constructors

Lb 

Fields

unLb :: Int
 

Instances

data Feat Source

Feature.

Constructors

TFeat3 

Fields

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

Fields

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

Fields

x1 :: !Lb
 
ln :: !Int
 
OFeat 

Fields

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

Instances

Eq Feat 
Ord Feat 
Show Feat 
Binary Feat 
FeatMap FeatMap Feat 
Binary (FeatMap Feat) 

data CRF a b Source

CRF model data.

Constructors

CRF 

Fields

numOfLayers :: Int
 
codecData :: CodecData a b
 
model :: Model FeatMap Ob [Lb] Feat
 

Instances

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

trainSource

Arguments

:: (Ord o, Ord t) 
=> Int

Number of tagging layers

-> FeatSel Ob [Lb] Feat

Feature selection

-> SgdArgs

Args for SGD

-> TrainCRF o [t] (CRF o t) 

Train the CRF using the stochastic gradient descent method. Use the provided feature selection function to determine model features.

tag :: (Ord o, Ord t) => CRF o t -> TagCRF o [t]Source

Find the most probable label sequence.

Feature selection

type FeatSel o t f = FeatGen o t f -> Xs o t -> Ys t -> [f]

A feature selection function type.

selectHidden :: FeatSel o t f

The hiddenFeats adapted to fit feature selection specs.

selectPresent :: FeatSel o t f

The presentFeats adapted to fit feature selection specs.