Class that applies language model on the fly using kenlm.
More...
#include <fstutils.applylmonthefly.hpp>
|
void | setMakeWeight (const MakeWeightT &mw) |
| Public methods. More...
|
|
| ApplyLanguageModelOnTheFly (KenLMModelT &model, unordered_set< Label > &epsilons, bool natlog, float lmscale, float lmwp, const IdBridgeT &idbridge, MakeWeightT &mw) |
|
| ApplyLanguageModelOnTheFly (KenLMModelT &model, bool natlog, float lmscale, float lmwp, const IdBridgeT &idbridge, MakeWeightT &mw) |
|
void | init () |
|
| ~ApplyLanguageModelOnTheFly () |
| Destructor. More...
|
|
VectorFst< Arc > * | run (const VectorFst< Arc > &fst) |
|
VectorFst< Arc > * | run (const VectorFst< Arc > &fst, unordered_set< Label > const &epsilons) |
|
VectorFst< Arc > * | run (const VectorFst< Arc > &fst, unsigned size, std::vector< std::vector< unsigned > > &srcWindows) |
|
VectorFst< Arc > * | operator() (const VectorFst< Arc > &fst) |
| functor: Run composition itself. Use for target-only LMs. More...
|
|
VectorFst< Arc > * | operator() (const VectorFst< Arc > &fst, unsigned srcSize, std::vector< std::vector< unsigned > > &srcw) |
|
virtual VectorFst< Arc > * | run (VectorFst< Arc > const &fst, unordered_set< typename Arc::Label > const &epsilons)=0 |
|
virtual | ~ApplyLanguageModelOnTheFlyInterface () |
|
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
class fst::ApplyLanguageModelOnTheFly< Arc, MakeWeightT, KenLMModelT, IdBridgeT, HackScoreT >
Class that applies language model on the fly using kenlm.
Definition at line 312 of file fstutils.applylmonthefly.hpp.
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
fst::ApplyLanguageModelOnTheFly< Arc, MakeWeightT, KenLMModelT, IdBridgeT, HackScoreT >::ApplyLanguageModelOnTheFly |
( |
KenLMModelT & |
model, |
|
|
unordered_set< Label > & |
epsilons, |
|
|
bool |
natlog, |
|
|
float |
lmscale, |
|
|
float |
lmwp, |
|
|
const IdBridgeT & |
idbridge, |
|
|
MakeWeightT & |
mw |
|
) |
| |
|
inline |
Constructor. Initializes on-the-fly composition with a language model.
- Parameters
-
fst | Machine you want to apply the language to. Pass a delayed machine if you can, as it will expand it in constructor. |
model | A KenLM language model |
epsilons | List of words to work as epsilons |
natlog | Use or not natural logs |
lmscale | Language model scale |
Definition at line 379 of file fstutils.applylmonthefly.hpp.
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
VectorFst<Arc>* fst::ApplyLanguageModelOnTheFly< Arc, MakeWeightT, KenLMModelT, IdBridgeT, HackScoreT >::operator() |
( |
const VectorFst< Arc > & |
fst, |
|
|
unsigned |
srcSize, |
|
|
std::vector< std::vector< unsigned > > & |
srcw |
|
) |
| |
|
inline |
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
VectorFst<Arc>* fst::ApplyLanguageModelOnTheFly< Arc, MakeWeightT, KenLMModelT, IdBridgeT, HackScoreT >::run |
( |
const VectorFst< Arc > & |
fst, |
|
|
unordered_set< Label > const & |
epsilons |
|
) |
| |
|
inline |
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
VectorFst<Arc>* fst::ApplyLanguageModelOnTheFly< Arc, MakeWeightT, KenLMModelT, IdBridgeT, HackScoreT >::run |
( |
const VectorFst< Arc > & |
fst, |
|
|
unsigned |
size, |
|
|
std::vector< std::vector< unsigned > > & |
srcWindows |
|
) |
| |
|
inlinevirtual |
template<class Arc, class MakeWeightT = MakeWeight<Arc>, class KenLMModelT = lm::ngram::Model, class IdBridgeT = ucam::fsttools::IdBridge, template< class > class HackScoreT = HackScore>
The documentation for this class was generated from the following file: