mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
Added implicit add-1 smoothing.
This commit is contained in:
parent
40fbe226e4
commit
9899364c46
@ -96,8 +96,8 @@ namespace ugdiss
|
|||||||
{
|
{
|
||||||
if (COOC.m1(s) == 0 || COOC.m2(t) == 0) return 1.0;
|
if (COOC.m1(s) == 0 || COOC.m2(t) == 0) return 1.0;
|
||||||
// if (!COOC[s][t]) cout << s << " " << t << endl;
|
// if (!COOC[s][t]) cout << s << " " << t << endl;
|
||||||
assert(COOC[s][t]);
|
// assert(COOC[s][t]);
|
||||||
return float(COOC[s][t])/COOC.m1(s);
|
return float(COOC[s][t]+1)/(COOC.m1(s)+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TKN>
|
template<typename TKN>
|
||||||
@ -106,8 +106,8 @@ namespace ugdiss
|
|||||||
plup_bwd(id_type const s, id_type const t) const
|
plup_bwd(id_type const s, id_type const t) const
|
||||||
{
|
{
|
||||||
if (COOC.m1(s) == 0 || COOC.m2(t) == 0) return 1.0;
|
if (COOC.m1(s) == 0 || COOC.m2(t) == 0) return 1.0;
|
||||||
assert(COOC[s][t]);
|
// assert(COOC[s][t]);
|
||||||
return float(COOC[s][t])/COOC.m2(t);
|
return float(COOC[s][t]+1)/(COOC.m2(t)+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TKN>
|
template<typename TKN>
|
||||||
|
Loading…
Reference in New Issue
Block a user