Safe Haskell | None |
---|---|

Language | Haskell98 |

## Synopsis

- newtype Ob = Ob {}
- newtype Lb = Lb {}
- data X
- mkX :: [Ob] -> [Lb] -> X
- unX :: X -> [Ob]
- unR :: AVec Lb -> X -> [Lb]
- newtype Y = Y {}
- mkY :: [(Lb, Double)] -> Y
- unY :: Y -> [(Lb, Double)]
- newtype AVec a = AVec {}
- fromList :: (Ord a, Unbox a) => [a] -> AVec a
- fromSet :: (Ord a, Unbox a) => Set a -> AVec a
- toAscList :: (Ord a, Unbox a) => AVec a -> [a]
- data Feature
- isSFeat :: Feature -> Bool
- isTFeat :: Feature -> Bool
- isOFeat :: Feature -> Bool

# Basic Types

An observation.

## Instances

A label.

## Instances

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

X | The word with default set of potential interpretations. |

R | The word with restricted set of potential labels. |

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.

An ascending vector of unique elements.

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

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

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

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

# Features

A Feature is either an observation feature OFeature o x, which models relation between observation o and label x assigned to the same word, or a transition feature TFeature x y (SFeature x for the first position in the sentence), which models relation between two subsequent labels, x (on i-th position) and y (on (i-1)-th positoin).