LatticeFasterOnlineDecoderTpl< FST > Class Template Reference

LatticeFasterOnlineDecoderTpl is as LatticeFasterDecoderTpl but also supports an efficient way to get the best path (see the function BestPathEnd()), which is useful in endpointing and in situations where you might want to frequently access the best path. More...

#include <lattice-faster-online-decoder.h>

Inheritance diagram for LatticeFasterOnlineDecoderTpl< FST >:
Collaboration diagram for LatticeFasterOnlineDecoderTpl< FST >:

Classes

struct  BestPathIterator
 

Public Types

using Arc = typename FST::Arc
 
using Label = typename Arc::Label
 
using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 
using Token = decoder::BackpointerToken
 
using ForwardLinkT = decoder::ForwardLink< Token >
 
- Public Types inherited from LatticeFasterDecoderTpl< FST, decoder::BackpointerToken >
using Arc = typename FST::Arc
 
using Label = typename Arc::Label
 
using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 
using ForwardLinkT = decoder::ForwardLink< decoder::BackpointerToken >
 

Public Member Functions

 LatticeFasterOnlineDecoderTpl (const FST &fst, const LatticeFasterDecoderConfig &config)
 
 LatticeFasterOnlineDecoderTpl (const LatticeFasterDecoderConfig &config, FST *fst)
 
bool GetBestPath (Lattice *ofst, bool use_final_probs=true) const
 Outputs an FST corresponding to the single best path through the lattice. More...
 
bool TestGetBestPath (bool use_final_probs=true) const
 This function does a self-test of GetBestPath(). More...
 
BestPathIterator BestPathEnd (bool use_final_probs, BaseFloat *final_cost=NULL) const
 This function returns an iterator that can be used to trace back the best path. More...
 
BestPathIterator TraceBackBestPath (BestPathIterator iter, LatticeArc *arc) const
 This function can be used in conjunction with BestPathEnd() to trace back the best path one link at a time (e.g. More...
 
bool GetRawLatticePruned (Lattice *ofst, bool use_final_probs, BaseFloat beam) const
 Behaves the same as GetRawLattice but only processes tokens whose extra_cost is smaller than the best-cost plus the specified beam. More...
 
 KALDI_DISALLOW_COPY_AND_ASSIGN (LatticeFasterOnlineDecoderTpl)
 
- Public Member Functions inherited from LatticeFasterDecoderTpl< FST, decoder::BackpointerToken >
 LatticeFasterDecoderTpl (const FST &fst, const LatticeFasterDecoderConfig &config)
 
 LatticeFasterDecoderTpl (const LatticeFasterDecoderConfig &config, FST *fst)
 
void SetOptions (const LatticeFasterDecoderConfig &config)
 
const LatticeFasterDecoderConfigGetOptions () const
 
 ~LatticeFasterDecoderTpl ()
 
bool Decode (DecodableInterface *decodable)
 Decodes until there are no more frames left in the "decodable" object. More...
 
bool ReachedFinal () const
 says whether a final-state was active on the last frame. More...
 
bool GetBestPath (Lattice *ofst, bool use_final_probs=true) const
 Outputs an FST corresponding to the single best path through the lattice. More...
 
bool GetRawLattice (Lattice *ofst, bool use_final_probs=true) const
 Outputs an FST corresponding to the raw, state-level tracebacks. More...
 
bool GetLattice (CompactLattice *ofst, bool use_final_probs=true) const
 [Deprecated, users should now use GetRawLattice and determinize it themselves, e.g. More...
 
void InitDecoding ()
 InitDecoding initializes the decoding, and should only be used if you intend to call AdvanceDecoding(). More...
 
void AdvanceDecoding (DecodableInterface *decodable, int32 max_num_frames=-1)
 This will decode until there are no more frames ready in the decodable object. More...
 
void FinalizeDecoding ()
 This function may be optionally called after AdvanceDecoding(), when you do not plan to decode any further. More...
 
BaseFloat FinalRelativeCost () const
 FinalRelativeCost() serves the same purpose as ReachedFinal(), but gives more information. More...
 
int32 NumFramesDecoded () const
 

Additional Inherited Members

- Protected Types inherited from LatticeFasterDecoderTpl< FST, decoder::BackpointerToken >
using Elem = typename HashList< StateId, decoder::BackpointerToken *>::Elem
 
- Protected Member Functions inherited from LatticeFasterDecoderTpl< FST, decoder::BackpointerToken >
void PossiblyResizeHash (size_t num_toks)
 
ElemFindOrAddToken (StateId state, int32 frame_plus_one, BaseFloat tot_cost, decoder::BackpointerToken *backpointer, bool *changed)
 
void PruneForwardLinks (int32 frame_plus_one, bool *extra_costs_changed, bool *links_pruned, BaseFloat delta)
 
void ComputeFinalCosts (unordered_map< decoder::BackpointerToken *, BaseFloat > *final_costs, BaseFloat *final_relative_cost, BaseFloat *final_best_cost) const
 
void PruneForwardLinksFinal ()
 
void PruneTokensForFrame (int32 frame_plus_one)
 
void PruneActiveTokens (BaseFloat delta)
 
BaseFloat GetCutoff (Elem *list_head, size_t *tok_count, BaseFloat *adaptive_beam, Elem **best_elem)
 Gets the weight cutoff. Also counts the active tokens. More...
 
BaseFloat ProcessEmitting (DecodableInterface *decodable)
 Processes emitting arcs for one frame. More...
 
void ProcessNonemitting (BaseFloat cost_cutoff)
 Processes nonemitting (epsilon) arcs for one frame. More...
 
void DeleteElems (Elem *list)
 
void ClearActiveTokens ()
 
 KALDI_DISALLOW_COPY_AND_ASSIGN (LatticeFasterDecoderTpl)
 
- Static Protected Member Functions inherited from LatticeFasterDecoderTpl< FST, decoder::BackpointerToken >
static void DeleteForwardLinks (decoder::BackpointerToken *tok)
 
static void TopSortTokens (decoder::BackpointerToken *tok_list, std::vector< decoder::BackpointerToken * > *topsorted_list)
 
- Protected Attributes inherited from LatticeFasterDecoderTpl< FST, decoder::BackpointerToken >
HashList< StateId, decoder::BackpointerToken *> toks_
 
std::vector< TokenList > active_toks_
 
std::vector< const Elem * > queue_
 
std::vector< BaseFloattmp_array_
 
const FST * fst_
 
bool delete_fst_
 
std::vector< BaseFloatcost_offsets_
 
LatticeFasterDecoderConfig config_
 
int32 num_toks_
 
bool warned_
 
bool decoding_finalized_
 decoding_finalized_ is true if someone called FinalizeDecoding(). More...
 
unordered_map< decoder::BackpointerToken *, BaseFloatfinal_costs_
 For the meaning of the next 3 variables, see the comment for decoding_finalized_ above., and ComputeFinalCosts(). More...
 
BaseFloat final_relative_cost_
 
BaseFloat final_best_cost_
 

Detailed Description

template<typename FST>
class kaldi::LatticeFasterOnlineDecoderTpl< FST >

LatticeFasterOnlineDecoderTpl is as LatticeFasterDecoderTpl but also supports an efficient way to get the best path (see the function BestPathEnd()), which is useful in endpointing and in situations where you might want to frequently access the best path.

This is only templated on the FST type, since the Token type is required to be BackpointerToken. Actually it only makes sense to instantiate LatticeFasterDecoderTpl with Token == BackpointerToken if you do so indirectly via this child class.

Definition at line 54 of file lattice-faster-online-decoder.h.

Member Typedef Documentation

◆ Arc

using Arc = typename FST::Arc

Definition at line 57 of file lattice-faster-online-decoder.h.

◆ ForwardLinkT

◆ Label

using Label = typename Arc::Label

Definition at line 58 of file lattice-faster-online-decoder.h.

◆ StateId

using StateId = typename Arc::StateId

Definition at line 59 of file lattice-faster-online-decoder.h.

◆ Token

◆ Weight

using Weight = typename Arc::Weight

Definition at line 60 of file lattice-faster-online-decoder.h.

Constructor & Destructor Documentation

◆ LatticeFasterOnlineDecoderTpl() [1/2]

LatticeFasterOnlineDecoderTpl ( const FST &  fst,
const LatticeFasterDecoderConfig config 
)
inline

Definition at line 67 of file lattice-faster-online-decoder.h.

68  :
69  LatticeFasterDecoderTpl<FST, Token>(fst, config) { }
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
Definition: graph.dox:21

◆ LatticeFasterOnlineDecoderTpl() [2/2]

LatticeFasterOnlineDecoderTpl ( const LatticeFasterDecoderConfig config,
FST *  fst 
)
inline

Definition at line 73 of file lattice-faster-online-decoder.h.

74  :
75  LatticeFasterDecoderTpl<FST, Token>(config, fst) { }
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
Definition: graph.dox:21

Member Function Documentation

◆ BestPathEnd()

LatticeFasterOnlineDecoderTpl< FST >::BestPathIterator BestPathEnd ( bool  use_final_probs,
BaseFloat final_cost = NULL 
) const

This function returns an iterator that can be used to trace back the best path.

If use_final_probs == true and at least one final state survived till the end, it will use the final-probs in working out the best final Token, and will output the final cost to *final_cost (if non-NULL), else it will use only the forward likelihood, and will put zero in *final_cost (if non-NULL). Requires that NumFramesDecoded() > 0.

Definition at line 78 of file lattice-faster-online-decoder.cc.

Referenced by OnlineSilenceWeighting::ComputeCurrentTraceback(), and LatticeFasterOnlineDecoderTpl< FST >::BestPathIterator::Done().

80  {
81  if (this->decoding_finalized_ && !use_final_probs)
82  KALDI_ERR << "You cannot call FinalizeDecoding() and then call "
83  << "BestPathEnd() with use_final_probs == false";
84  KALDI_ASSERT(this->NumFramesDecoded() > 0 &&
85  "You cannot call BestPathEnd if no frames were decoded.");
86 
87  unordered_map<Token*, BaseFloat> final_costs_local;
88 
89  const unordered_map<Token*, BaseFloat> &final_costs =
90  (this->decoding_finalized_ ? this->final_costs_ :final_costs_local);
91  if (!this->decoding_finalized_ && use_final_probs)
92  this->ComputeFinalCosts(&final_costs_local, NULL, NULL);
93 
94  // Singly linked list of tokens on last frame (access list through "next"
95  // pointer).
96  BaseFloat best_cost = std::numeric_limits<BaseFloat>::infinity();
97  BaseFloat best_final_cost = 0;
98  Token *best_tok = NULL;
99  for (Token *tok = this->active_toks_.back().toks;
100  tok != NULL; tok = tok->next) {
101  BaseFloat cost = tok->tot_cost, final_cost = 0.0;
102  if (use_final_probs && !final_costs.empty()) {
103  // if we are instructed to use final-probs, and any final tokens were
104  // active on final frame, include the final-prob in the cost of the token.
105  typename unordered_map<Token*, BaseFloat>::const_iterator
106  iter = final_costs.find(tok);
107  if (iter != final_costs.end()) {
108  final_cost = iter->second;
109  cost += final_cost;
110  } else {
111  cost = std::numeric_limits<BaseFloat>::infinity();
112  }
113  }
114  if (cost < best_cost) {
115  best_cost = cost;
116  best_tok = tok;
117  best_final_cost = final_cost;
118  }
119  }
120  if (best_tok == NULL) { // this should not happen, and is likely a code error or
121  // caused by infinities in likelihoods, but I'm not making
122  // it a fatal error for now.
123  KALDI_WARN << "No final token found.";
124  }
125  if (final_cost_out)
126  *final_cost_out = best_final_cost;
127  return BestPathIterator(best_tok, this->NumFramesDecoded() - 1);
128 }
float BaseFloat
Definition: kaldi-types.h:29
unordered_map< decoder::BackpointerToken *, BaseFloat > final_costs_
For the meaning of the next 3 variables, see the comment for decoding_finalized_ above., and ComputeFinalCosts().
#define KALDI_ERR
Definition: kaldi-error.h:147
#define KALDI_WARN
Definition: kaldi-error.h:150
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185
void ComputeFinalCosts(unordered_map< decoder::BackpointerToken *, BaseFloat > *final_costs, BaseFloat *final_relative_cost, BaseFloat *final_best_cost) const
bool decoding_finalized_
decoding_finalized_ is true if someone called FinalizeDecoding().

◆ GetBestPath()

bool GetBestPath ( Lattice ofst,
bool  use_final_probs = true 
) const

Outputs an FST corresponding to the single best path through the lattice.

This is quite efficient because it doesn't get the entire raw lattice and find the best path through it; instead, it uses the BestPathEnd and BestPathIterator so it basically traces it back through the lattice. Returns true if result is nonempty (using the return status is deprecated, it will become void). If "use_final_probs" is true AND we reached the final-state of the graph then it will include those as final-probs, else it will treat all final-probs as one.

Definition at line 56 of file lattice-faster-online-decoder.cc.

Referenced by LatticeFasterOnlineDecoderTpl< FST >::BestPathIterator::Done(), SingleUtteranceNnet2Decoder::GetBestPath(), SingleUtteranceGmmDecoder::GetBestPath(), and SingleUtteranceNnet2DecoderThreaded::GetBestPath().

57  {
58  olat->DeleteStates();
59  BaseFloat final_graph_cost;
60  BestPathIterator iter = BestPathEnd(use_final_probs, &final_graph_cost);
61  if (iter.Done())
62  return false; // would have printed warning.
63  StateId state = olat->AddState();
64  olat->SetFinal(state, LatticeWeight(final_graph_cost, 0.0));
65  while (!iter.Done()) {
66  LatticeArc arc;
67  iter = TraceBackBestPath(iter, &arc);
68  arc.nextstate = state;
69  StateId new_state = olat->AddState();
70  olat->AddArc(new_state, arc);
71  state = new_state;
72  }
73  olat->SetStart(state);
74  return true;
75 }
fst::ArcTpl< LatticeWeight > LatticeArc
Definition: kaldi-lattice.h:40
fst::LatticeWeightTpl< BaseFloat > LatticeWeight
Definition: kaldi-lattice.h:32
float BaseFloat
Definition: kaldi-types.h:29
BestPathIterator TraceBackBestPath(BestPathIterator iter, LatticeArc *arc) const
This function can be used in conjunction with BestPathEnd() to trace back the best path one link at a...
BestPathIterator BestPathEnd(bool use_final_probs, BaseFloat *final_cost=NULL) const
This function returns an iterator that can be used to trace back the best path.

◆ GetRawLatticePruned()

bool GetRawLatticePruned ( Lattice ofst,
bool  use_final_probs,
BaseFloat  beam 
) const

Behaves the same as GetRawLattice but only processes tokens whose extra_cost is smaller than the best-cost plus the specified beam.

It is only worthwhile to call this function if beam is less than the lattice_beam specified in the config; otherwise, it would return essentially the same thing as GetRawLattice, but more slowly.

Definition at line 168 of file lattice-faster-online-decoder.cc.

Referenced by LatticeFasterOnlineDecoderTpl< FST >::BestPathIterator::Done(), and SingleUtteranceGmmDecoder::GetGaussianPosteriors().

171  {
172  typedef LatticeArc Arc;
173  typedef Arc::StateId StateId;
174  typedef Arc::Weight Weight;
175  typedef Arc::Label Label;
176 
177  // Note: you can't use the old interface (Decode()) if you want to
178  // get the lattice with use_final_probs = false. You'd have to do
179  // InitDecoding() and then AdvanceDecoding().
180  if (this->decoding_finalized_ && !use_final_probs)
181  KALDI_ERR << "You cannot call FinalizeDecoding() and then call "
182  << "GetRawLattice() with use_final_probs == false";
183 
184  unordered_map<Token*, BaseFloat> final_costs_local;
185 
186  const unordered_map<Token*, BaseFloat> &final_costs =
187  (this->decoding_finalized_ ? this->final_costs_ : final_costs_local);
188  if (!this->decoding_finalized_ && use_final_probs)
189  this->ComputeFinalCosts(&final_costs_local, NULL, NULL);
190 
191  ofst->DeleteStates();
192  // num-frames plus one (since frames are one-based, and we have
193  // an extra frame for the start-state).
194  int32 num_frames = this->active_toks_.size() - 1;
195  KALDI_ASSERT(num_frames > 0);
196  for (int32 f = 0; f <= num_frames; f++) {
197  if (this->active_toks_[f].toks == NULL) {
198  KALDI_WARN << "No tokens active on frame " << f
199  << ": not producing lattice.\n";
200  return false;
201  }
202  }
203  unordered_map<Token*, StateId> tok_map;
204  std::queue<std::pair<Token*, int32> > tok_queue;
205  // First initialize the queue and states. Put the initial state on the queue;
206  // this is the last token in the list active_toks_[0].toks.
207  for (Token *tok = this->active_toks_[0].toks;
208  tok != NULL; tok = tok->next) {
209  if (tok->next == NULL) {
210  tok_map[tok] = ofst->AddState();
211  ofst->SetStart(tok_map[tok]);
212  std::pair<Token*, int32> tok_pair(tok, 0); // #frame = 0
213  tok_queue.push(tok_pair);
214  }
215  }
216 
217  // Next create states for "good" tokens
218  while (!tok_queue.empty()) {
219  std::pair<Token*, int32> cur_tok_pair = tok_queue.front();
220  tok_queue.pop();
221  Token *cur_tok = cur_tok_pair.first;
222  int32 cur_frame = cur_tok_pair.second;
223  KALDI_ASSERT(cur_frame >= 0 &&
224  cur_frame <= this->cost_offsets_.size());
225 
226  typename unordered_map<Token*, StateId>::const_iterator iter =
227  tok_map.find(cur_tok);
228  KALDI_ASSERT(iter != tok_map.end());
229  StateId cur_state = iter->second;
230 
231  for (ForwardLinkT *l = cur_tok->links;
232  l != NULL;
233  l = l->next) {
234  Token *next_tok = l->next_tok;
235  if (next_tok->extra_cost < beam) {
236  // so both the current and the next token are good; create the arc
237  int32 next_frame = l->ilabel == 0 ? cur_frame : cur_frame + 1;
238  StateId nextstate;
239  if (tok_map.find(next_tok) == tok_map.end()) {
240  nextstate = tok_map[next_tok] = ofst->AddState();
241  tok_queue.push(std::pair<Token*, int32>(next_tok, next_frame));
242  } else {
243  nextstate = tok_map[next_tok];
244  }
245  BaseFloat cost_offset = (l->ilabel != 0 ?
246  this->cost_offsets_[cur_frame] : 0);
247  Arc arc(l->ilabel, l->olabel,
248  Weight(l->graph_cost, l->acoustic_cost - cost_offset),
249  nextstate);
250  ofst->AddArc(cur_state, arc);
251  }
252  }
253  if (cur_frame == num_frames) {
254  if (use_final_probs && !final_costs.empty()) {
255  typename unordered_map<Token*, BaseFloat>::const_iterator iter =
256  final_costs.find(cur_tok);
257  if (iter != final_costs.end())
258  ofst->SetFinal(cur_state, LatticeWeight(iter->second, 0));
259  } else {
260  ofst->SetFinal(cur_state, LatticeWeight::One());
261  }
262  }
263  }
264  return (ofst->NumStates() != 0);
265 }
fst::StdArc::StateId StateId
fst::ArcTpl< LatticeWeight > LatticeArc
Definition: kaldi-lattice.h:40
static const LatticeWeightTpl One()
kaldi::int32 int32
fst::LatticeWeightTpl< BaseFloat > LatticeWeight
Definition: kaldi-lattice.h:32
float BaseFloat
Definition: kaldi-types.h:29
unordered_map< decoder::BackpointerToken *, BaseFloat > final_costs_
For the meaning of the next 3 variables, see the comment for decoding_finalized_ above., and ComputeFinalCosts().
#define KALDI_ERR
Definition: kaldi-error.h:147
#define KALDI_WARN
Definition: kaldi-error.h:150
fst::StdArc::Label Label
fst::StdArc::Weight Weight
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185
void ComputeFinalCosts(unordered_map< decoder::BackpointerToken *, BaseFloat > *final_costs, BaseFloat *final_relative_cost, BaseFloat *final_best_cost) const
bool decoding_finalized_
decoding_finalized_ is true if someone called FinalizeDecoding().

◆ KALDI_DISALLOW_COPY_AND_ASSIGN()

KALDI_DISALLOW_COPY_AND_ASSIGN ( LatticeFasterOnlineDecoderTpl< FST >  )

◆ TestGetBestPath()

bool TestGetBestPath ( bool  use_final_probs = true) const

This function does a self-test of GetBestPath().

Returns true on success; returns false and prints a warning on failure.

Definition at line 33 of file lattice-faster-online-decoder.cc.

Referenced by LatticeFasterOnlineDecoderTpl< FST >::BestPathIterator::Done().

34  {
35  Lattice lat1;
36  {
37  Lattice raw_lat;
38  this->GetRawLattice(&raw_lat, use_final_probs);
39  ShortestPath(raw_lat, &lat1);
40  }
41  Lattice lat2;
42  GetBestPath(&lat2, use_final_probs);
43  BaseFloat delta = 0.1;
44  int32 num_paths = 1;
45  if (!fst::RandEquivalent(lat1, lat2, num_paths, delta, rand())) {
46  KALDI_WARN << "Best-path test failed";
47  return false;
48  } else {
49  return true;
50  }
51 }
bool GetRawLattice(Lattice *ofst, bool use_final_probs=true) const
Outputs an FST corresponding to the raw, state-level tracebacks.
kaldi::int32 int32
float BaseFloat
Definition: kaldi-types.h:29
fst::VectorFst< LatticeArc > Lattice
Definition: kaldi-lattice.h:44
#define KALDI_WARN
Definition: kaldi-error.h:150
bool GetBestPath(Lattice *ofst, bool use_final_probs=true) const
Outputs an FST corresponding to the single best path through the lattice.

◆ TraceBackBestPath()

LatticeFasterOnlineDecoderTpl< FST >::BestPathIterator TraceBackBestPath ( BestPathIterator  iter,
LatticeArc arc 
) const

This function can be used in conjunction with BestPathEnd() to trace back the best path one link at a time (e.g.

this can be useful in endpoint detection). By "link" we mean a link in the graph; not all links cross frame boundaries, but each time you see a nonzero ilabel you can interpret that as a frame. The return value is the updated iterator. It outputs the ilabel and olabel, and the (graph and acoustic) weight to the "arc" pointer, while leaving its "nextstate" variable unchanged.

Definition at line 132 of file lattice-faster-online-decoder.cc.

Referenced by OnlineSilenceWeighting::ComputeCurrentTraceback(), and LatticeFasterOnlineDecoderTpl< FST >::BestPathIterator::Done().

133  {
134  KALDI_ASSERT(!iter.Done() && oarc != NULL);
135  Token *tok = static_cast<Token*>(iter.tok);
136  int32 cur_t = iter.frame, ret_t = cur_t;
137  if (tok->backpointer != NULL) {
138  ForwardLinkT *link;
139  for (link = tok->backpointer->links;
140  link != NULL; link = link->next) {
141  if (link->next_tok == tok) { // this is the link to "tok"
142  oarc->ilabel = link->ilabel;
143  oarc->olabel = link->olabel;
144  BaseFloat graph_cost = link->graph_cost,
145  acoustic_cost = link->acoustic_cost;
146  if (link->ilabel != 0) {
147  KALDI_ASSERT(static_cast<size_t>(cur_t) < this->cost_offsets_.size());
148  acoustic_cost -= this->cost_offsets_[cur_t];
149  ret_t--;
150  }
151  oarc->weight = LatticeWeight(graph_cost, acoustic_cost);
152  break;
153  }
154  }
155  if (link == NULL) { // Did not find correct link.
156  KALDI_ERR << "Error tracing best-path back (likely "
157  << "bug in token-pruning algorithm)";
158  }
159  } else {
160  oarc->ilabel = 0;
161  oarc->olabel = 0;
162  oarc->weight = LatticeWeight::One(); // zero costs.
163  }
164  return BestPathIterator(tok->backpointer, ret_t);
165 }
static const LatticeWeightTpl One()
kaldi::int32 int32
fst::LatticeWeightTpl< BaseFloat > LatticeWeight
Definition: kaldi-lattice.h:32
float BaseFloat
Definition: kaldi-types.h:29
#define KALDI_ERR
Definition: kaldi-error.h:147
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185

The documentation for this class was generated from the following files: