concraft-0.14.2: Morphological disambiguation based on constrained CRFs

Safe HaskellNone
LanguageHaskell98

NLP.Concraft.Disamb

Contents

Synopsis

Model

data Disamb Source #

A disambiguation model.

Constructors

Disamb 

Fields

Instances
Binary Disamb Source # 
Instance details

Defined in NLP.Concraft.Disamb

Methods

put :: Disamb -> Put #

get :: Get Disamb #

putList :: [Disamb] -> Put #

Tiers

data Tier Source #

A tier description.

Constructors

Tier 

Fields

Instances
Binary Tier Source # 
Instance details

Defined in NLP.Concraft.Disamb.Positional

Methods

put :: Tier -> Put #

get :: Get Tier #

putList :: [Tier] -> Put #

data Atom Source #

An atomic part of morphosyntactic tag with optional POS.

Constructors

Atom 

Fields

Instances
Eq Atom Source # 
Instance details

Defined in NLP.Concraft.Disamb.Positional

Methods

(==) :: Atom -> Atom -> Bool #

(/=) :: Atom -> Atom -> Bool #

Ord Atom Source # 
Instance details

Defined in NLP.Concraft.Disamb.Positional

Methods

compare :: Atom -> Atom -> Ordering #

(<) :: Atom -> Atom -> Bool #

(<=) :: Atom -> Atom -> Bool #

(>) :: Atom -> Atom -> Bool #

(>=) :: Atom -> Atom -> Bool #

max :: Atom -> Atom -> Atom #

min :: Atom -> Atom -> Atom #

Show Atom Source # 
Instance details

Defined in NLP.Concraft.Disamb.Positional

Methods

showsPrec :: Int -> Atom -> ShowS #

show :: Atom -> String #

showList :: [Atom] -> ShowS #

Binary Atom Source # 
Instance details

Defined in NLP.Concraft.Disamb.Positional

Methods

put :: Atom -> Put #

get :: Get Atom #

putList :: [Atom] -> Put #

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.