diff options
author | Rico Sennrich <rico.sennrich@gmx.ch> | 2013-04-22 15:21:59 +0400 |
---|---|---|
committer | Rico Sennrich <rico.sennrich@gmx.ch> | 2013-04-22 15:21:59 +0400 |
commit | 908c006e320bafa030896428ae3648d32b2094cb (patch) | |
tree | 554e46abb659353b1da394c9f9b96cd6dd2a0c5e /moses/Util.h | |
parent | 477f9135855e68b33245bb56125b3ca65b1f5c64 (diff) |
online combination of multiple phrase tables
- creates a virtual phrase table at decoding time based on a vector of component models and a combination algorithm
- linear interpolation or instance weighting
- two possible component model types supported so far: 0 (in-memory) or 12 (compact)
- weights can be set in config, and overriden on a sentence-level through mosesserver API
- online optimization (perplexity minimization) using dlib and xmlrpc-c call
Diffstat (limited to 'moses/Util.h')
-rw-r--r-- | moses/Util.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/moses/Util.h b/moses/Util.h index c2d1ecef4..9f43d9dc3 100644 --- a/moses/Util.h +++ b/moses/Util.h @@ -310,7 +310,7 @@ inline float CalcTranslationScore(const std::vector<float> &probVector, return out.str(); \ } \ -//! delete and remove every element of a collection object such as map, set, list etc +//! delete and remove every element of a collection object such as set, list etc template<class COLL> void RemoveAllInColl(COLL &coll) { @@ -320,6 +320,17 @@ void RemoveAllInColl(COLL &coll) coll.clear(); } +//! delete and remove every element of map +template<class COLL> +void RemoveAllInMap(COLL &coll) +{ + for (typename COLL::const_iterator iter = coll.begin() ; iter != coll.end() ; ++iter) { + delete (iter->second); + } + coll.clear(); +} + + //! x-platform reference to temp folder std::string GetTempFolder(); //! MD5 hash of a file |