Safe Haskell | None |
---|---|
Language | Haskell2010 |
Internal implementation of the CRF model.
Synopsis
- newtype FeatIx = FeatIx {}
- data Model = Model {}
- mkModel :: [Feature] -> Model
- lbSet :: Model -> [Lb]
- valueL :: Model -> FeatIx -> LogFloat
- featToIx :: Model -> Feature -> FeatIx
- featToInt :: Model -> Feature -> Int
- sgValue :: Model -> Lb -> LogFloat
- sgIxs :: Model -> [LbIx]
- obIxs :: Model -> Ob -> [LbIx]
- nextIxs :: Model -> Lb -> [LbIx]
- prevIxs :: Model -> Lb -> [LbIx]
Documentation
A feature index. To every model feature a unique index is assigned.
Instances
The model is realy a map from features to potentials, but for the sake of efficiency the internal representation is more complex.
Model | |
|
mkModel :: [Feature] -> Model Source #
Construct the model from the list of features. All parameters will be set to 0. There may be repetitions in the input list.
valueL :: Model -> FeatIx -> LogFloat Source #
Model potential defined for the given feature interpreted as a number in logarithmic domain.
featToInt :: Model -> Feature -> Int Source #
Same as featToIx
but immediately unwrap the feature index to
integer value.
sgValue :: Model -> Lb -> LogFloat Source #
Potential value (in log domain) of the singular feature with the given label. The value defaults to 0 when the feature is not a member of the model.
sgIxs :: Model -> [LbIx] Source #
List of labels which can be located on the first position of a sentence together with feature indices determined by them.
obIxs :: Model -> Ob -> [LbIx] Source #
List of labels which constitute a valid feature in combination with the given observation accompanied by feature indices determined by these labels.