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

Language | Haskell98 |

Inference with CRFs.

## Synopsis

- tag :: Model -> DAG a X -> DAG a Lb
- tagK :: Int -> Model -> DAG a X -> DAG a [(Lb, LogFloat)]
- marginals :: Model -> DAG a X -> DAG a [(Lb, LogFloat)]
- accuracy :: Model -> [DAG a (X, Y)] -> Double
- expectedFeaturesIn :: Model -> DAG a X -> [(FeatIx, LogFloat)]
- zx :: Model -> DAG a X -> LogFloat
- zx' :: Model -> DAG a X -> LogFloat
- computePsi :: Model -> DAG a X -> EdgeID -> LbIx -> LogFloat

# Documentation

tag :: Model -> DAG a X -> DAG a Lb Source #

Find the most probable label sequence (with probabilities of individual lables determined with respect to marginal distributions) satisfying the constraints imposed over label values.

tagK :: Int -> Model -> DAG a X -> DAG a [(Lb, LogFloat)] Source #

Get (at most) k best tags for each word and return them in descending order. TODO: Tagging with respect to marginal distributions might not be the best idea. Think of some more elegant method.

marginals :: Model -> DAG a X -> DAG a [(Lb, LogFloat)] Source #

Tag potential labels with marginal distributions. marginals :: Md.Model -> DAG a X -> [[(Lb, L.LogFloat)]]

accuracy :: Model -> [DAG a (X, Y)] -> Double Source #

Compute the accuracy of the model with respect to the labeled dataset.

expectedFeaturesIn :: Model -> DAG a X -> [(FeatIx, LogFloat)] Source #

A list of features (represented by feature indices) defined within the context of the sentence accompanied by expected probabilities determined on the basis of the model.

One feature can occur multiple times in the output list.

zx :: Model -> DAG a X -> LogFloat Source #

Normalization factor computed for the `Xs`

sentence using the
backward computation.

zx' :: Model -> DAG a X -> LogFloat Source #

Normalization factor computed for the `Xs`

sentence using the
forward computation.