concraft-0.5.0: Morphological disambiguation based on constrained CRFs

Safe HaskellNone

NLP.Concraft.Disamb

Contents

Synopsis

Model

data Disamb Source

A disambiguation model.

Constructors

Disamb 

Fields

tiers :: [Tier]
 
schemaConf :: SchemaConf
 
crf :: CRF Ob Atom
 

Instances

data CRF a b Source

CRF model data.

Instances

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

Tiers

data Tier Source

A tier description.

Constructors

Tier 

Fields

withPos :: Bool

Does it include the part of speech?

withAtts :: Set Attr

Tier grammatical attributes.

Instances

data Atom Source

An atomic part of morphosyntactic tag with optional POS.

Constructors

Atom 

Fields

pos :: Maybe POS
 
atts :: Map Attr Text
 

Instances

Disambiguation

disamb :: Word w => Disamb -> Sent w Tag -> [Tag]Source

Perform context-sensitive disambiguation.

include :: (Sent w Tag -> [Tag]) -> Sent w Tag -> Sent w TagSource

Insert disambiguation results into the sentence.

disambSent :: Word w => Disamb -> Sent w Tag -> Sent w TagSource

Combine disamb with include.

Training

data TrainConf Source

Training configuration.

Constructors

TrainConf 

trainSource

Arguments

:: Word w 
=> TrainConf

Training configuration

-> [Sent w Tag]

Training data

-> Maybe [Sent w Tag]

Maybe evaluation data

-> IO Disamb

Resultant model

Train disamb model.