From f4a96ee777d7d250cc51a32e8374548de235df18 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sun, 6 Mar 2011 17:10:13 -0500 Subject: support feature collapsing with new span features --- decoder/ff_spans.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'decoder/ff_spans.cc') diff --git a/decoder/ff_spans.cc b/decoder/ff_spans.cc index 17e1d650..89335682 100644 --- a/decoder/ff_spans.cc +++ b/decoder/ff_spans.cc @@ -151,8 +151,8 @@ void SpanFeatures::PrepareForInput(const SentenceMetadata& smeta) { bfid << "BS:" << TD::Convert(bword); beg_span_ids_[i] = FD::Convert(bfid.str()); if (use_collapsed_features_) { - end_span_vals_[i] = feat2val_[sfid.str()]; - beg_span_vals_[i] = feat2val_[bfid.str()]; + end_span_vals_[i] = feat2val_[sfid.str()] + feat2val_[esbiid.str()]; + beg_span_vals_[i] = feat2val_[bfid.str()] + feat2val_[bsbiid.str()]; } } for (int i = 0; i <= lattice.size(); ++i) { @@ -175,8 +175,8 @@ void SpanFeatures::PrepareForInput(const SentenceMetadata& smeta) { len_span_feats_(i,j).first = FD::Convert(lf.str()); len_span_feats_(i,j).second = FD::Convert("S_" + lf.str()); if (use_collapsed_features_) { - span_vals_(i,j).first = feat2val_[pf.str()]; - span_vals_(i,j).second = feat2val_["S_" + pf.str()]; + span_vals_(i,j).first = feat2val_[pf.str()] + feat2val_[lf.str()]; + span_vals_(i,j).second = feat2val_["S_" + pf.str()] + feat2val_["S_" + lf.str()]; } } } -- cgit v1.2.3