Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
reranker::CandidateSetReader Class Reference

A class for reading streams of training or test instances, where each training or test instance is a reranker::CandidateSet object. More...

#include <candidate-set-reader.H>

Public Member Functions

 CandidateSetReader (long reporting_interval=100)
 Constructs a new instance. More...
 
 CandidateSetReader (int max_num_to_read, int max_candidates_per_set, long reporting_interval=100)
 
virtual ~CandidateSetReader ()
 
void Open (const string &filename, bool compressed, bool use_base64, bool reset_counters=true)
 
void Read (const string &filename, bool compressed, bool use_base64, bool reset_counters, vector< shared_ptr< CandidateSet > > &examples)
 Reads a stream of CandidateSet instances from the specified file or from standard input. More...
 
shared_ptr< CandidateSetReadNext (bool &reader_valid)
 
void Close ()
 
void Reset ()
 Resets this reader so that its internal count of the number of CandidateSet’s read goes back to zero. More...
 
void ClearStrings ()
 Invokes CandidateSetProtoReader::ClearStrings on the internal CandidateSetProtoReader instance. More...
 
long num_read ()
 Returns the number of CandidateSet instances read since the last invocation of the Reset method. More...
 
long total_num_read ()
 Returns the total number of CandidateSet instances read. More...
 
void set_verbosity (int verbosity)
 Sets the verbosity of this reader (mostly for debugging purposes). More...
 

Detailed Description

A class for reading streams of training or test instances, where each training or test instance is a reranker::CandidateSet object.

Definition at line 62 of file candidate-set-reader.H.

Constructor & Destructor Documentation

reranker::CandidateSetReader::CandidateSetReader ( long  reporting_interval = 100)
inline

Constructs a new instance.

Definition at line 65 of file candidate-set-reader.H.

reranker::CandidateSetReader::CandidateSetReader ( int  max_num_to_read,
int  max_candidates_per_set,
long  reporting_interval = 100 
)
inline

Definition at line 74 of file candidate-set-reader.H.

virtual reranker::CandidateSetReader::~CandidateSetReader ( )
inlinevirtual

Definition at line 85 of file candidate-set-reader.H.

Member Function Documentation

void reranker::CandidateSetReader::ClearStrings ( )
inline

Invokes CandidateSetProtoReader::ClearStrings on the internal CandidateSetProtoReader instance.

Definition at line 195 of file candidate-set-reader.H.

void reranker::CandidateSetReader::Close ( )
inline

Definition at line 176 of file candidate-set-reader.H.

long reranker::CandidateSetReader::num_read ( )
inline

Returns the number of CandidateSet instances read since the last invocation of the Reset method.

Definition at line 203 of file candidate-set-reader.H.

void reranker::CandidateSetReader::Open ( const string &  filename,
bool  compressed,
bool  use_base64,
bool  reset_counters = true 
)
inline

Definition at line 87 of file candidate-set-reader.H.

void reranker::CandidateSetReader::Read ( const string &  filename,
bool  compressed,
bool  use_base64,
bool  reset_counters,
vector< shared_ptr< CandidateSet > > &  examples 
)
inline

Reads a stream of CandidateSet instances from the specified file or from standard input.

Parameters
[in]filenamethe filename from which to read; specify "-" to read from standard input
[in]compressedwhether the input stream is compressed
[in]use_base64whether to do base64 decoding
[in]reset_counterswhether to invoke Reset prior to opening the specified file
[out]examplesthe vector of pointers to CandidateSet instances to which to append (pointers to) newly-read and -constructed CandidateSet instances

Definition at line 118 of file candidate-set-reader.H.

shared_ptr<CandidateSet> reranker::CandidateSetReader::ReadNext ( bool &  reader_valid)
inline

Definition at line 136 of file candidate-set-reader.H.

void reranker::CandidateSetReader::Reset ( )
inline

Resets this reader so that its internal count of the number of CandidateSet’s read goes back to zero.

Definition at line 188 of file candidate-set-reader.H.

void reranker::CandidateSetReader::set_verbosity ( int  verbosity)
inline

Sets the verbosity of this reader (mostly for debugging purposes).

There are currently four levels:

LevelMeaning
0 None
1 Basic output
2 Very verbose output
3 Extremely verbose output
Parameters
verbositythe new verbosity level for this reader to have

Definition at line 221 of file candidate-set-reader.H.

long reranker::CandidateSetReader::total_num_read ( )
inline

Returns the total number of CandidateSet instances read.

Definition at line 206 of file candidate-set-reader.H.


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