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

Safe HaskellSafe
LanguageHaskell98

Data.CRF.Chain2.Tiers.Dataset.External

Description

External data representation.

Synopsis

Documentation

data Word a b Source #

A word consists of a set of observations and a set of potential labels.

Instances
(Eq a, Eq b) => Eq (Word a b) Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Dataset.External

Methods

(==) :: Word a b -> Word a b -> Bool #

(/=) :: Word a b -> Word a b -> Bool #

(Ord a, Ord b) => Ord (Word a b) Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Dataset.External

Methods

compare :: Word a b -> Word a b -> Ordering #

(<) :: Word a b -> Word a b -> Bool #

(<=) :: Word a b -> Word a b -> Bool #

(>) :: Word a b -> Word a b -> Bool #

(>=) :: Word a b -> Word a b -> Bool #

max :: Word a b -> Word a b -> Word a b #

min :: Word a b -> Word a b -> Word a b #

(Show a, Show b) => Show (Word a b) Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Dataset.External

Methods

showsPrec :: Int -> Word a b -> ShowS #

show :: Word a b -> String #

showList :: [Word a b] -> ShowS #

mkWord :: Set a -> Set [b] -> Word a b Source #

A word constructor which checks non-emptiness of the potential set of labels.

type Sent a b = [Word a b] Source #

A sentence of words.

data Prob a Source #

A probability distribution defined over elements of type a. All elements not included in the map have probability equal to 0.

Instances
Eq a => Eq (Prob a) Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Dataset.External

Methods

(==) :: Prob a -> Prob a -> Bool #

(/=) :: Prob a -> Prob a -> Bool #

Ord a => Ord (Prob a) Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Dataset.External

Methods

compare :: Prob a -> Prob a -> Ordering #

(<) :: Prob a -> Prob a -> Bool #

(<=) :: Prob a -> Prob a -> Bool #

(>) :: Prob a -> Prob a -> Bool #

(>=) :: Prob a -> Prob a -> Bool #

max :: Prob a -> Prob a -> Prob a #

min :: Prob a -> Prob a -> Prob a #

Show a => Show (Prob a) Source # 
Instance details

Defined in Data.CRF.Chain2.Tiers.Dataset.External

Methods

showsPrec :: Int -> Prob a -> ShowS #

show :: Prob a -> String #

showList :: [Prob a] -> ShowS #

mkProb :: Ord a => [(a, Double)] -> Prob a Source #

Construct the probability distribution.

Normalization is not performed because, when working with DAGs, the probability of a specific DAG edge can be lower than 1 (in particular, it can be 0).

Elements with probability 0 cab be filtered out since information that a given label is a potential interpretation of the given word/edge is preserved at the level of the Word

type WordL a b = (Word a b, Prob [b]) Source #

A WordL is a labeled word, i.e. a word with probability distribution defined over labels. We assume that every label from the distribution domain is a member of the set of potential labels corresponding to the word. TODO: Ensure the assumption using the smart constructor.

type SentL a b = [WordL a b] Source #

A sentence of labeled words.