Hi,
it seems scores and extra have changed the location in the phrase table.
The attached patch got me a lot further along, I changed the order in
the output as well.
Not sure if
if (print_cooc_counts) os << " ||| " << pp.cfe << " " << pp.cf << "
" << pp.ce;
if (print_neglog_significance) os << " ||| " << pp.nlog_pte;
still prints things in the correct order (pt-filter.cpp lines 144 - 145.
best regards
Christof
On 9/24/10 1:37 PM, Christof Pintaske wrote:
Hi,
I just updated my moses installation to trunk. Unfortunately I found
that filter-pt is now crashing instead of pruning. The patch below fixed
the bleeding for me. However even with that patch I receive plenty of
error messages:
No occurrences found
and the pruned table is just too small to be true. Does filter-pt get
out of step because the phrase table has now 5 records instead of 3 (my
old installation is from June). filter-pt.cpp seems to be completely
unchanged compared to the June installation.
Any hints or fixes are welcome.
best regards
Christof
diff -wc sigtest-filter/filter-pt.cpp
../moses-2010-06-04/sigtest-filter/filter-pt.cpp
*** sigtest-filter/filter-pt.cpp 2010-09-24 13:19:34.000000000 -0700
--- ../moses-2010-06-04/sigtest-filter/filter-pt.cpp 2010-06-04
15:33:39.000000000 -0700
***************
*** 103,111 ****
}
}
}
- if (i != scores.end()) {
++i;
- }
char f[24];
char *fp=f;
while (i != scores.end()&& *i != ' ') {
_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support
*** filter-pt.cpp 2010-09-24 14:45:19.000000000 -0700
--- /export/home/moses/src/moses-2010-06-04/sigtest-filter/filter-pt.cpp
2010-06-04 15:33:39.000000000 -0700
***************
*** 87,105 ****
{
size_t pos = 0;
std::string::size_type nextPos = str.find(SEPARATOR, pos);
! this->f_phrase = str.substr(pos,nextPos);
!
! pos = nextPos + SEPARATOR.size();
! nextPos = str.find(SEPARATOR, pos);
! this->e_phrase = str.substr(pos,nextPos-pos);
!
! pos = nextPos + SEPARATOR.size();
nextPos = str.find(SEPARATOR, pos);
! this->scores = str.substr(pos,nextPos-pos);
!
! pos = nextPos + SEPARATOR.size();
! this->extra = str.substr(pos);
!
int c = 0;
std::string::iterator i=scores.begin();
if (index > 0) {
--- 87,98 ----
{
size_t pos = 0;
std::string::size_type nextPos = str.find(SEPARATOR, pos);
! this->f_phrase = str.substr(pos,nextPos); pos = nextPos +
SEPARATOR.size();
nextPos = str.find(SEPARATOR, pos);
! this->e_phrase = str.substr(pos,nextPos-pos); pos = nextPos +
SEPARATOR.size();
! nextPos = str.rfind(SEPARATOR);
! this->extra = str.substr(pos, ((nextPos > pos)?(nextPos-pos):0));
! this->scores = str.substr(nextPos + SEPARATOR.size(),std::string::npos);
int c = 0;
std::string::iterator i=scores.begin();
if (index > 0) {
***************
*** 110,118 ****
}
}
}
- if (i != scores.end()) {
++i;
- }
char f[24];
char *fp=f;
while (i != scores.end() && *i != ' ') {
--- 103,109 ----
***************
*** 139,146 ****
std::ostream& operator << (std::ostream& os, const PTEntry& pp)
{
os << pp.f_phrase << " ||| " << pp.e_phrase;
- os << " ||| " << pp.scores;
if (pp.extra.size()>0) os << " ||| " << pp.extra;
if (print_cooc_counts) os << " ||| " << pp.cfe << " " << pp.cf << " " <<
pp.ce;
if (print_neglog_significance) os << " ||| " << pp.nlog_pte;
return os;
--- 130,137 ----
std::ostream& operator << (std::ostream& os, const PTEntry& pp)
{
os << pp.f_phrase << " ||| " << pp.e_phrase;
if (pp.extra.size()>0) os << " ||| " << pp.extra;
+ os << " ||| " << pp.scores;
if (print_cooc_counts) os << " ||| " << pp.cfe << " " << pp.cf << " " <<
pp.ce;
if (print_neglog_significance) os << " ||| " << pp.nlog_pte;
return os;
_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support