MosesTuning::Data Class Reference

#include <Data.h>

Collaboration diagram for MosesTuning::Data:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Data (Scorer *scorer, const std::string &sparseweightsfile="")
void clear ()
ScoreDataHandle getScoreData ()
FeatureDataHandle getFeatureData ()
ScorergetScorer ()
std::size_t NumberOfFeatures () const
std::string Features () const
void Features (const std::string &f)
void loadNBest (const std::string &file, bool oneBest=false)
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, int sentence_index)


Detailed Description

Definition at line 29 of file Data.h.


Constructor & Destructor Documentation

MosesTuning::Data::Data ( Scorer scorer,
const std::string &  sparseweightsfile = "" 
) [explicit]


Member Function Documentation

void MosesTuning::Data::AddFeatures ( const std::string &  str,
int  sentence_index 
)

void MosesTuning::Data::clear (  )  [inline]

Definition at line 42 of file Data.h.

void MosesTuning::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.

bool MosesTuning::Data::existsFeatureNames (  )  const [inline]

Definition at line 80 of file Data.h.

void MosesTuning::Data::Features ( const std::string &  f  )  [inline]

Definition at line 66 of file Data.h.

std::string MosesTuning::Data::Features (  )  const [inline]

Definition at line 63 of file Data.h.

FeatureDataHandle MosesTuning::Data::getFeatureData (  )  [inline]

Definition at line 51 of file Data.h.

Referenced by main().

Here is the caller graph for this function:

std::size_t MosesTuning::Data::getFeatureIndex ( const std::string &  name  )  const [inline]

Definition at line 88 of file Data.h.

std::string MosesTuning::Data::getFeatureName ( std::size_t  idx  )  const [inline]

Definition at line 84 of file Data.h.

ScoreDataHandle MosesTuning::Data::getScoreData (  )  [inline]

Definition at line 47 of file Data.h.

Scorer* MosesTuning::Data::getScorer (  )  [inline]

Definition at line 55 of file Data.h.

Referenced by main().

Here is the caller graph for this function:

void MosesTuning::Data::InitFeatureMap ( const std::string &  str  ) 

void MosesTuning::Data::load ( const std::string &  featfile,
const std::string &  scorefile 
)

Definition at line 133 of file Data.cpp.

void MosesTuning::Data::loadNBest ( const std::string &  file,
bool  oneBest = false 
)

std::size_t MosesTuning::Data::NumberOfFeatures (  )  const [inline]

Definition at line 59 of file Data.h.

void MosesTuning::Data::removeDuplicates (  ) 

void MosesTuning::Data::save ( const std::string &  featfile,
const std::string &  scorefile,
bool  bin = false 
)

Definition at line 198 of file Data.cpp.


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

Generated on Thu Jul 6 00:34:14 2017 for Moses by  doxygen 1.5.9