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

Safe HaskellNone
LanguageHaskell98

Data.CRF.Chain2.Tiers.DAG.Feature

Contents

Description

Feature extraction module for DAG-aware CRFs.

Synopsis

Feature

data Feat Source #

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

Constructors

TFeat3

Second-order transition feature.

Fields

TFeat2

First-order transition feature.

Fields

TFeat1

Zero-order transition feature.

Fields

OFeat

Observation feature.

Fields

Instances
Eq Feat Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Core

Methods

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

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

Ord Feat Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Core

Methods

compare :: Feat -> Feat -> Ordering #

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

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

(>) :: Feat -> Feat -> Bool #

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

max :: Feat -> Feat -> Feat #

min :: Feat -> Feat -> Feat #

Show Feat Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Core

Methods

showsPrec :: Int -> Feat -> ShowS #

show :: Feat -> String #

showList :: [Feat] -> ShowS #

Binary Feat Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Core

Methods

put :: Feat -> Put #

get :: Get Feat #

putList :: [Feat] -> Put #

Featre extraction

Present features

presentFeats :: DAG a (X, Y) -> [(Feat, LogFloat)] Source #

Present Features of all kinds occurring in the given DAG.

Hidden features

data EdgeIx Source #

Edge with the corresponding label index.

Constructors

EdgeIx 

Fields

Instances
Eq EdgeIx Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.DAG.Feature

Methods

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

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

Ord EdgeIx Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.DAG.Feature

Show EdgeIx Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.DAG.Feature

hiddenFeats :: DAG a X -> [Feat] Source #

Features hidden in the dataset element.

obFeatsOn :: DAG a X -> EdgeIx -> [Feat] Source #

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

trFeatsOn Source #

Arguments

:: DAG a X 
-> Maybe EdgeIx

Current EdgeIx

-> Maybe EdgeIx

Previous EdgeIx

-> Maybe EdgeIx

One before the previous EdgeIx

-> [Feat] 

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

Feature selection

type FeatSel a = DAG a (X, Y) -> [Feat] Source #

A feature selection function type.

selectPresent :: FeatSel a Source #

The presentFeats adapted to fit feature selection specs.

selectHidden :: FeatSel a Source #

The hiddenFeats adapted to fit feature selection specs.

Indexing

lbNum :: DAG a X -> EdgeID -> Int Source #

Number of potential labels at the given position of the sentence.

lbIxs :: DAG a X -> EdgeID -> [CbIx] Source #

List of label indices at the given edge.

edgeIxs :: DAG a X -> EdgeID -> [EdgeIx] Source #

The list of EdgeIx's corresponding to the given edge.

prevEdgeIxs :: DAG a X -> Maybe EdgeID -> [Maybe EdgeIx] Source #

The list of EdgeIx's corresponding to the previous edges. If the argument edgeID is Nothing or if the list of previous edges is empty, the result will be a singleton list containing Nothing (which represents a special out-of-bounds EdgeIx).

nextEdgeIxs :: DAG a X -> Maybe EdgeID -> [Maybe EdgeIx] Source #

Similar to prevEdgeIxs but returns the succeeding edges.

initialEdgeIxs :: DAG a X -> [EdgeIx] Source #

Obtain the list of initial EdgeIxs.

finalEdgeIxs :: DAG a X -> [EdgeIx] Source #

Obtain the list of final EdgeIxs.