Download mosesdecoder/moses2/TranslationModel/PhraseTable.h from suricodes/hindi-sindhi-docker: direct link, hf CLI and curl.
- Browser
- Download file 3.29 kB
-
https://huggingface.co/spaces/suricodes/hindi-sindhi-docker/resolve/main/mosesdecoder/moses2/TranslationModel/PhraseTable.h
- Command line
-
hf download hf://spaces/suricodes/hindi-sindhi-docker/mosesdecoder/moses2/TranslationModel/PhraseTable.h
-
curl -L -o PhraseTable.h https://huggingface.co/spaces/suricodes/hindi-sindhi-docker/resolve/main/mosesdecoder/moses2/TranslationModel/PhraseTable.h
3.29 kB
| /* | |
| * PhraseTable.h | |
| * | |
| * Created on: 23 Oct 2015 | |
| * Author: hieu | |
| */ | |
| namespace Moses2 | |
| { | |
| class System; | |
| class InputPathsBase; | |
| class InputPath; | |
| class Manager; | |
| class TargetPhrases; | |
| class Range; | |
| namespace SCFG | |
| { | |
| class InputPath; | |
| class Stacks; | |
| class Manager; | |
| class ActiveChartEntry; | |
| } | |
| //////////////////////////////////////////////////////////////////////// | |
| class PhraseTable: public StatelessFeatureFunction | |
| { | |
| public: | |
| int decodeGraphBackoff; | |
| PhraseTable(size_t startInd, const std::string &line); | |
| virtual ~PhraseTable(); | |
| virtual void SetParameter(const std::string& key, const std::string& value); | |
| virtual void Lookup(const Manager &mgr, InputPathsBase &inputPaths) const; | |
| virtual TargetPhrases *Lookup(const Manager &mgr, MemPool &pool, | |
| InputPath &inputPath) const; | |
| void SetPtInd(size_t ind) { | |
| m_ptInd = ind; | |
| } | |
| size_t GetPtInd() const { | |
| return m_ptInd; | |
| } | |
| bool SatisfyBackoff(const Manager &mgr, const InputPath &path) const; | |
| virtual void | |
| EvaluateInIsolation(MemPool &pool, const System &system, const Phrase<Moses2::Word> &source, | |
| const TargetPhraseImpl &targetPhrase, Scores &scores, | |
| SCORE &estimatedScore) const; | |
| virtual void | |
| EvaluateInIsolation(MemPool &pool, const System &system, const Phrase<SCFG::Word> &source, | |
| const TargetPhrase<SCFG::Word> &targetPhrase, Scores &scores, | |
| SCORE &estimatedScore) const; | |
| // scfg | |
| virtual void InitActiveChart( | |
| MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| SCFG::InputPath &path) const = 0; | |
| virtual void Lookup( | |
| MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| size_t maxChartSpan, | |
| const SCFG::Stacks &stacks, | |
| SCFG::InputPath &path) const = 0; | |
| virtual void LookupUnary(MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| const SCFG::Stacks &stacks, | |
| SCFG::InputPath &path) const; | |
| protected: | |
| std::string m_path; | |
| size_t m_ptInd; // in the order that it is list in [feature], NOT order of [mapping] | |
| size_t m_tableLimit; | |
| std::vector<FactorType> m_input, m_output; | |
| // cache | |
| size_t m_maxCacheSize; // 0 = no caching | |
| struct CacheCollEntry2 { | |
| TargetPhrases *tpsPtr; | |
| clock_t clock; | |
| }; | |
| // scfg | |
| virtual void LookupNT( | |
| MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| const Moses2::Range &subPhraseRange, | |
| const SCFG::InputPath &prevPath, | |
| const SCFG::Stacks &stacks, | |
| SCFG::InputPath &outPath) const; | |
| virtual void LookupGivenWord( | |
| MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| const SCFG::InputPath &prevPath, | |
| const SCFG::Word &wordSought, | |
| const Moses2::Hypotheses *hypos, | |
| const Moses2::Range &subPhraseRange, | |
| SCFG::InputPath &outPath) const; | |
| virtual void LookupGivenNode( | |
| MemPool &pool, | |
| const SCFG::Manager &mgr, | |
| const SCFG::ActiveChartEntry &prevEntry, | |
| const SCFG::Word &wordSought, | |
| const Moses2::Hypotheses *hypos, | |
| const Moses2::Range &subPhraseRange, | |
| SCFG::InputPath &outPath) const = 0; | |
| }; | |
| } | |