crf-chain1-constrained-0.1.1: First-order, constrained, linear-chain conditional random fields

Data.CRF.Chain1.Constrained.Dataset.Internal

Synopsis

# Documentation

newtype Ob Source

An observation.

Constructors

 Ob FieldsunOb :: Int

Instances

 Eq Ob Ord Ob Read Ob Show Ob Binary Ob Unbox Ob Vector Vector Ob MVector MVector Ob

newtype Lb Source

A label.

Constructors

 Lb FieldsunLb :: Int

Instances

 Eq Lb Num Lb Ord Lb Read Lb Show Lb Ix Lb Binary Lb Unbox Lb Vector Vector Lb MVector MVector Lb

data X Source

A word represented by a list of its observations and a list of its potential label interpretations.

Constructors

 X The word with default set of potential interpretations. Fields_unX :: AVec Ob R The word with custom set of potential labels. Fields_unX :: AVec Ob _unR :: AVec Lb

Instances

 Eq X Ord X Read X Show X

mkX :: [Ob] -> [Lb] -> XSource

X constructor.

unX :: X -> [Ob]Source

List of observations.

unR :: AVec Lb -> X -> [Lb]Source

List of potential labels.

type Xs = Vector XSource

Sentence of words.

newtype Y Source

Probability distribution over labels. We assume, that when y is a member of chosen labels list it is also a member of the list potential labels for corresponding `X` word. TODO: Perhaps we should substitute `Lb`s with label indices corresponding to labels from the vector of potential labels? FIXME: The type definition is incorrect (see `fromList` definition), it should be something like AVec2.

Constructors

 Y Fields_unY :: AVec (Lb, Double)

Instances

 Eq Y Ord Y Read Y Show Y

mkY :: [(Lb, Double)] -> YSource

Y constructor.

unY :: Y -> [(Lb, Double)]Source

Y deconstructor symetric to mkY.

type Ys = Vector YSource

Sentence of Y (label choices).

data AVec a Source

Ascending vector of unique interger elements.

Instances

 (Eq a, Unbox a) => Eq (AVec a) (Eq (AVec a), Ord a, Unbox a) => Ord (AVec a) (Read a, Unbox a) => Read (AVec a) (Show a, Unbox a) => Show (AVec a) (Binary a, Unbox a) => Binary (AVec a)

fromList :: (Ord a, Unbox a) => [a] -> AVec aSource

Smart AVec constructor which ensures that the underlying vector satisfies the AVec properties.

fromSet :: (Ord a, Unbox a) => Set a -> AVec aSource

Smart AVec constructor which ensures that the underlying vector satisfies the AVec properties.