transducer training from (input,output) string pairs
More...
Go to the source code of this file.
Typedefs |
typedef struct gfsmTrainConfig_ | gfsmTrainConfig |
| low-level type for gfsm_automaton_train() computation state
|
typedef GPtrArray | gfsmTrainPath |
| low-level type for a successful training-path: GPtrArray* of gfsmTrainConfig*
|
Detailed Description
Typedef Documentation
Function Documentation
allocate a new gfsmTrainer for training source FST fst
- Parameters
-
fst | automaton to be trained: it will be destructively altered by this call (weights changed to indices) |
- Returns
- new gfsmTrainer
void gfsm_trainer_free |
( |
gfsmTrainer * |
trainer, |
|
|
gboolean |
free_fst |
|
) |
| |
free a gfsmTrainer
- Parameters
-
free_fst | if true, the underlying FST will also be freed if still present. |
extract an automaton representing the training counts from a gfsmTrainer trainer.
- Parameters
-
trainer | trainer from which to extract FST topology and counts |
steal | if true, trainer->fst will be used directly, invalidating trainer for any futher calls except for gfsm_trainer_free(). |
- Returns
- modified trainer->fst if steal is true, otherwise a clone whose weights are counts as stored in trainer->counts
transducer weight-training utility: count successful paths in training FST for the i/o pair (input, output), updating trainer->counts corresponding to fst arc- and final-weights. On completion, each count is the (real)-sum of its original value and the number of occurrences of the corresponding arc (rsp. final state) in any successful path in fst with labels (input, output). May be run multiple times on the same trainer to add counts for multiple (input, output) pairs.
- Parameters
-
trainer | transducer trainer, which should have been initialized as by gfsm_trainer_new() |
input | input labels (lower) |
output | output labels (upper) |