mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 22:14:57 +03:00
Merge branch 'master' of github.com:moses-smt/mosesdecoder
This commit is contained in:
commit
9a7ad99104
@ -1 +1 @@
|
||||
Subproject commit 4e51345cd6b405551ba327d91a7d905e204587b1
|
||||
Subproject commit fe569f6ad720306e0f354922494eb0203befb165
|
@ -68,8 +68,16 @@ void CderScorer::prepareStatsVector(size_t sid, const string& text, vector<int>&
|
||||
const sent_t& ref = m_ref_sentences[rid][sid];
|
||||
tmp.clear();
|
||||
computeCD(cand, ref, tmp);
|
||||
if (calculateScore(tmp) > max) {
|
||||
int score = calculateScore(tmp);
|
||||
if (rid == 0)
|
||||
{
|
||||
stats = tmp;
|
||||
max = score;
|
||||
}
|
||||
else if (score > max)
|
||||
{
|
||||
stats = tmp;
|
||||
max = score;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -94,8 +102,12 @@ void CderScorer::computeCD(const sent_t& cand, const sent_t& ref,
|
||||
vector<int>* row = new vector<int>(I);
|
||||
|
||||
// Initialization of first row
|
||||
(*row)[0] = 0;
|
||||
for (int i = 1; i < I; ++i) (*row)[i] = 1;
|
||||
for (int i = 0; i < I; ++i) (*row)[i] = i;
|
||||
|
||||
// For CDER metric, the initialization is different
|
||||
if (m_allowed_long_jumps) {
|
||||
for (int i = 1; i < I; ++i) (*row)[i] = 1;
|
||||
}
|
||||
|
||||
// Calculating costs for next row using costs from the previous row.
|
||||
while (++l < L) {
|
||||
|
2
scripts/training/create_count_tables.py
Normal file → Executable file
2
scripts/training/create_count_tables.py
Normal file → Executable file
@ -71,7 +71,7 @@ def create_count_lines(fobj, countobj, countobj_target, prune=0):
|
||||
|
||||
i = 0
|
||||
original_pos = 0
|
||||
source = ""
|
||||
source = b""
|
||||
store_lines = set()
|
||||
for line in fobj:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user