ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Private Attributes | List of all members
meta::parser::sr_parser::training_data Class Reference

Training data for the parser. More...

#include <training_data.h>

Public Member Functions

 training_data (std::vector< parse_tree > &trees, std::default_random_engine::result_type seed)
 
transition_map preprocess ()
 Preprocesses all of the training trees. More...
 
void shuffle ()
 Shuffles the training data.
 
size_t size () const
 
const parse_treetree (size_t idx) const
 
const std::vector< trans_id > & transitions (size_t idx) const
 

Private Attributes

std::vector< parse_tree > & trees_
 A reference to the collection of training trees.
 
std::vector< std::vector< trans_id > > all_transitions_
 The gold standard transitions for each tree.
 
std::vector< size_t > indices_
 The vector of indices used for fast shuffling.
 
std::default_random_engine rng_
 The random number generator used for shuffling.
 

Detailed Description

Training data for the parser.

Constructor & Destructor Documentation

meta::parser::sr_parser::training_data::training_data ( std::vector< parse_tree > &  trees,
std::default_random_engine::result_type  seed 
)
Parameters
treesThe raw training data
seedThe seed to used for seeding the rng for shuffling examples

Member Function Documentation

auto meta::parser::sr_parser::training_data::preprocess ( )

Preprocesses all of the training trees.

This currently runs the following transformations across all of the training data:

Returns
a transition_map to associate all transition names with ids in the binarized training data
size_t meta::parser::sr_parser::training_data::size ( ) const
Returns
the number of training examples
const parse_tree & meta::parser::sr_parser::training_data::tree ( size_t  idx) const
Parameters
idxThe index to seek into the training data
Returns
the parse tree at that position in the training data
auto meta::parser::sr_parser::training_data::transitions ( size_t  idx) const
Parameters
idxThe index to seek into the training data
Returns
the transitions taken to assemble the gold tree

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