summaryrefslogtreecommitdiff
path: root/decoder/ff_spans.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-03-06 17:10:13 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2011-03-06 17:10:13 -0500
commitf4a96ee777d7d250cc51a32e8374548de235df18 (patch)
treef744c963e0e8fbdc580b328dd8b61f820206df06 /decoder/ff_spans.cc
parent8cc05e205fd21c18e2091255413b96fc412e3ef8 (diff)
support feature collapsing with new span features
Diffstat (limited to 'decoder/ff_spans.cc')
-rw-r--r--decoder/ff_spans.cc8
1 files changed, 4 insertions, 4 deletions
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()];
}
}
}