#include <Data.h>
Public Member Functions | |
Data (Scorer *scorer) | |
Data () | |
void | clear () |
ScoreDataHandle | getScoreData () |
FeatureDataHandle | getFeatureData () |
Scorer * | getScorer () |
std::size_t | NumberOfFeatures () const |
void | NumberOfFeatures (std::size_t v) |
std::string | Features () const |
void | Features (const std::string &f) |
bool | hasSparseFeatures () const |
void | mergeSparseFeatures () |
void | loadNBest (const std::string &file) |
void | load (const std::string &featfile, const std::string &scorefile) |
void | save (const std::string &featfile, const std::string &scorefile, bool bin=false) |
void | removeDuplicates () |
bool | existsFeatureNames () const |
std::string | getFeatureName (std::size_t idx) const |
std::size_t | getFeatureIndex (const std::string &name) const |
void | createShards (std::size_t shard_count, float shard_size, const std::string &scorerconfig, std::vector< Data > &shards) |
void | InitFeatureMap (const std::string &str) |
void | AddFeatures (const std::string &str, const std::string &sentence_index) |
Definition at line 26 of file Data.h.
Data::Data | ( | Scorer * | scorer | ) | [explicit] |
Definition at line 29 of file Data.cpp.
References Scorer::getName(), and TRACE_ERR.
void Data::AddFeatures | ( | const std::string & | str, | |
const std::string & | sentence_index | |||
) |
void Data::createShards | ( | std::size_t | shard_count, | |
float | shard_size, | |||
const std::string & | scorerconfig, | |||
std::vector< Data > & | shards | |||
) |
Create shard_count shards. If shard_size == 0, then the shards are non-overlapping and exhaust the data. If 0 < shard_size <= 1, then shards are chosen by sampling the data (with replacement) and shard_size is interpreted as the proportion of the total size.
FeatureDataHandle Data::getFeatureData | ( | ) | [inline] |
std::size_t Data::getFeatureIndex | ( | const std::string & | name | ) | const [inline] |
std::string Data::getFeatureName | ( | std::size_t | idx | ) | const [inline] |
ScoreDataHandle Data::getScoreData | ( | ) | [inline] |
Scorer* Data::getScorer | ( | ) | [inline] |
void Data::InitFeatureMap | ( | const std::string & | str | ) |
void Data::load | ( | const std::string & | featfile, | |
const std::string & | scorefile | |||
) |
void Data::loadNBest | ( | const std::string & | file | ) |
void Data::removeDuplicates | ( | ) |
Definition at line 44 of file Data.cpp.
References ScoreArray::get(), FeatureStats::get(), FeatureArray::get(), ScoreArray::resize(), FeatureArray::resize(), FeatureStats::size(), ScoreArray::size(), FeatureArray::size(), ScoreArray::swap(), and FeatureArray::swap().
void Data::save | ( | const std::string & | featfile, | |
const std::string & | scorefile, | |||
bool | bin = false | |||
) |