concraft-0.9.4: Morphological disambiguation based on constrained CRFs

Safe HaskellNone
LanguageHaskell98

NLP.Concraft.Disamb

Contents

Synopsis

Model

data Disamb Source

A disambiguation model.

Constructors

Disamb 

Fields

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

Instances

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

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

Tag labels with marginal probabilities.

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

Perform context-sensitive disambiguation.

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

Insert disambiguation results into the sentence.

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

Combine disamb with include.

Training

data TrainConf Source

Training configuration.

train Source

Arguments

:: Word w 
=> TrainConf

Training configuration

-> IO [Sent w Tag]

Training data

-> IO [Sent w Tag]

Evaluation data

-> IO Disamb

Resultant model

Train disamb model.

Pruning

prune :: Double -> Disamb -> Disamb Source

Prune disamb model: discard model features with absolute values (in log-domain) lower than the given threshold.