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

Safe HaskellNone

Data.CRF.Chain1.Constrained.Dataset.Internal

Synopsis

Documentation

newtype Ob Source

An observation.

Constructors

Ob 

Fields

unOb :: Int
 

newtype Lb Source

A label.

Constructors

Lb 

Fields

unLb :: Int
 

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 Lbs with label indices corresponding to labels from the vector of potential labels?

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.