Safe Haskell | None |
---|
Internal implementation of the CRF model.
- 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.
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] -> ModelSource
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 -> LogFloatSource
Model potential defined for the given feature interpreted as a number in logarithmic domain.
featToInt :: Model -> Feature -> IntSource
Same as featToIx
but immediately unwrap the feature index to
integer value.
sgValue :: Model -> Lb -> LogFloatSource
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.