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

Safe HaskellSafe-Inferred
LanguageHaskell98

Data.CRF.Chain1.Constrained.Dataset.External

Synopsis

Documentation

data Word a b Source

A Word is represented by a set of observations and a set of potential interpretation labels. When the set of potential labels is empty the word is considered to be unknown and the default potential set is used in its place.

Constructors

Word 

Fields

obs :: Set a

The set of observations

lbs :: Set b

The set of potential interpretations.

Instances

(Eq a, Eq b) => Eq (Word a b) 
(Ord a, Ord b) => Ord (Word a b) 
(Show a, Show b) => Show (Word a b) 

unknown :: Word a b -> Bool Source

The word is considered to be unknown when the set of potential labels is empty.

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) 
Ord a => Ord (Prob a) 
Show a => Show (Prob a) 

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

Construct the probability distribution.

data WordL a 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. Use the mkWordL smart constructor to build WordL.

mkWordL :: Word a b -> Prob b -> WordL a b Source

Ensure, that every label from the distribution domain is a member of the set of potential labels corresponding to the word.

type SentL a b = [WordL a b] Source

A sentence of labeled words.