diff options
| author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-04-07 16:58:55 +0200 | 
|---|---|---|
| committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-04-07 16:58:55 +0200 | 
| commit | 715245dc7042ac0dca4fea94031d7c6de8058033 (patch) | |
| tree | 3a7ff0b88f2e113a08aef663d2487edec0b5f67f /gi/pf/hpyp_tm.h | |
| parent | 89211ab30937672d84a54fac8fa435805499e38d (diff) | |
| parent | 6001b81eba37985d2e7dea6e6ebb488b787789a6 (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'gi/pf/hpyp_tm.h')
| -rw-r--r-- | gi/pf/hpyp_tm.h | 38 | 
1 files changed, 38 insertions, 0 deletions
| diff --git a/gi/pf/hpyp_tm.h b/gi/pf/hpyp_tm.h new file mode 100644 index 00000000..af3215ba --- /dev/null +++ b/gi/pf/hpyp_tm.h @@ -0,0 +1,38 @@ +#ifndef HPYP_LEX_TRANS +#define HPYP_LEX_TRANS + +#include <vector> +#include "wordid.h" +#include "prob.h" +#include "sampler.h" +#include "freqdict.h" +#include "poisson_uniform_word_model.h" + +struct FreqBinner; +template <class B> struct PYPWordModel; +template <typename T, class B> struct ConditionalPYPWordModel; + +struct HPYPLexicalTranslation { +  explicit HPYPLexicalTranslation(const std::vector<std::vector<WordID> >& lets, +                                 const unsigned vocab_size, +                                 const unsigned num_letters); + +  prob_t Likelihood() const; + +  void ResampleHyperparameters(MT19937* rng); +  prob_t Prob(WordID src, WordID trg) const;  // return p(trg | src) +  void Summary() const; +  void Increment(WordID src, WordID trg, MT19937* rng); +  void Decrement(WordID src, WordID trg, MT19937* rng); +  unsigned UniqueConditioningContexts() const; + + private: +  const std::vector<std::vector<WordID> >& letters;   // spelling dictionary +  PoissonUniformWordModel base;  // "generator" of English types +  PYPWordModel<PoissonUniformWordModel>* up0;  // model English lexicon +  ConditionalPYPWordModel<PYPWordModel<PoissonUniformWordModel>, FreqBinner>* tmodel;  // translation distributions +                      // (model English word | French word) +  const WordID kX; +}; + +#endif | 
