Safe Haskell | None |
---|---|
Language | Haskell98 |
- type Codec a b = (AtomCodec a, Vector (AtomCodec (Maybe b)))
- type CodecM a b c = Codec (Codec a b) c
- obMax :: Codec a b -> Ob
- lbMax :: Codec a b -> [Lb]
- encodeWord'Cu :: (Ord a, Ord b) => Word a b -> CodecM a b X
- encodeWord'Cn :: (Ord a, Ord b) => Word a b -> CodecM a b X
- encodeSent'Cu :: (Ord a, Ord b) => Sent a b -> CodecM a b Xs
- encodeSent'Cn :: (Ord a, Ord b) => Sent a b -> CodecM a b Xs
- encodeSent :: (Ord a, Ord b) => Codec a b -> Sent a b -> Xs
- encodeWordL'Cu :: (Ord a, Ord b) => WordL a b -> CodecM a b (X, Y)
- encodeWordL'Cn :: (Ord a, Ord b) => WordL a b -> CodecM a b (X, Y)
- encodeSentL'Cu :: (Ord a, Ord b) => SentL a b -> CodecM a b (Xs, Ys)
- encodeSentL'Cn :: (Ord a, Ord b) => SentL a b -> CodecM a b (Xs, Ys)
- encodeSentL :: (Ord a, Ord b) => Codec a b -> SentL a b -> (Xs, Ys)
- decodeLabel :: Ord b => Codec a b -> Cb -> Maybe [b]
- decodeLabels :: Ord b => Codec a b -> [Cb] -> [Maybe [b]]
- mkCodec :: (Ord a, Ord b) => Int -> [SentL a b] -> Codec a b
- encodeData :: (Ord a, Ord b) => Codec a b -> [Sent a b] -> [Xs]
- encodeDataL :: (Ord a, Ord b) => Codec a b -> [SentL a b] -> [(Xs, Ys)]
- unJust :: Ord b => Codec a b -> Word a b -> Maybe [b] -> [b]
Documentation
type Codec a b = (AtomCodec a, Vector (AtomCodec (Maybe b))) Source
Codec internal data. The first component is used to encode observations of type a, the second one is used to encode labels of type [b].
encodeWord'Cu :: (Ord a, Ord b) => Word a b -> CodecM a b X Source
Encode the word and update the codec.
encodeWord'Cn :: (Ord a, Ord b) => Word a b -> CodecM a b X Source
Encode the word and do *not* update the codec.
encodeSent'Cu :: (Ord a, Ord b) => Sent a b -> CodecM a b Xs Source
Encode the sentence and update the codec.
encodeSent'Cn :: (Ord a, Ord b) => Sent a b -> CodecM a b Xs Source
Encode the sentence and do *not* update the codec.
encodeSent :: (Ord a, Ord b) => Codec a b -> Sent a b -> Xs Source
Encode the sentence using the given codec.
encodeWordL'Cu :: (Ord a, Ord b) => WordL a b -> CodecM a b (X, Y) Source
Encode the labeled word and update the codec.
encodeWordL'Cn :: (Ord a, Ord b) => WordL a b -> CodecM a b (X, Y) Source
Encodec the labeled word and do *not* update the codec.
encodeSentL'Cu :: (Ord a, Ord b) => SentL a b -> CodecM a b (Xs, Ys) Source
Encode the labeled sentence and update the codec.
encodeSentL'Cn :: (Ord a, Ord b) => SentL a b -> CodecM a b (Xs, Ys) Source
Encode the labeled sentence and do *not* update the codec. Substitute the default label for any label not present in the codec.
encodeSentL :: (Ord a, Ord b) => Codec a b -> SentL a b -> (Xs, Ys) Source
Encode the labeled sentence with the given codec. Substitute the default label for any label not present in the codec.
mkCodec :: (Ord a, Ord b) => Int -> [SentL a b] -> Codec a b Source
Create codec on the basis of the labeled dataset.
encodeData :: (Ord a, Ord b) => Codec a b -> [Sent a b] -> [Xs] Source
Encode the dataset with the codec.