diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-07-28 18:35:11 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-07-28 18:35:11 -0400 |
commit | 16d0e2a34df3e32e8992aeda3ad2de7a6e525f14 (patch) | |
tree | b7fb0f5b0de309a08ba1bde504ed9067e1aabaa3 /decoder/hg.h | |
parent | b81b2e85bdfd5e9dda98a6e448e6354ca0c6d26b (diff) |
slight improvement to the way NTs are handled in the FST-CFG composition algorithm, new rescoring mode
Diffstat (limited to 'decoder/hg.h')
-rw-r--r-- | decoder/hg.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/decoder/hg.h b/decoder/hg.h index 91d25f01..591e98ce 100644 --- a/decoder/hg.h +++ b/decoder/hg.h @@ -148,7 +148,7 @@ public: void show(std::ostream &o,unsigned mask=SPAN|RULE) const { o<<'{'; if (mask&CATEGORY) - o<<TD::Convert(rule_->GetLHS()); + o<< '[' << TD::Convert(-rule_->GetLHS()) << ']'; if (mask&PREV_SPAN) o<<'<'<<prev_i_<<','<<prev_j_<<'>'; if (mask&SPAN) @@ -156,9 +156,9 @@ public: if (mask&PROB) o<<" p="<<edge_prob_; if (mask&FEATURES) - o<<" "<<feature_values_; + o<<' '<<feature_values_; if (mask&RULE) - o<<rule_->AsString(mask&RULE_LHS); + o<<' '<<rule_->AsString(mask&RULE_LHS); if (USE_INFO_EDGE) { std::string const& i=info(); if (mask&&!i.empty()) o << " |||"<<i; // remember, the initial space is expected as part of i @@ -384,14 +384,6 @@ public: // compute the total number of paths in the forest double NumberOfPaths() const; - // BEWARE. this assumes that the source and target language - // strings are identical and that there are no loops. - // It assumes a bunch of other things about where the - // epsilons will be. It tries to assert failure if you - // break these assumptions, but it may not. - // TODO - make this work - void EpsilonRemove(WordID eps); - // multiple the weights vector by the edge feature vector // (inner product) to set the edge probabilities template <class V> @@ -535,9 +527,6 @@ public: private: Hypergraph(int num_nodes, int num_edges, bool is_lc) : is_linear_chain_(is_lc), nodes_(num_nodes), edges_(num_edges),edges_topo_(true) {} - - static TRulePtr kEPSRule; - static TRulePtr kUnaryRule; }; |