all it does is to evaluate BLEU score More...
Public Types | |
typedef std::shared_ptr< DataWriter > | ptr |
Public Member Functions | |
BLEUScoreWriter (std::shared_ptr< std::istream > referenceTextInput, Vocabulary::ptr vocabulary, int maxOrder=4) | |
void | write (const int *hOutputData, int actualOutputSequenceLength, int actualInputSequenceLength) override |
write the generated sequence More... | |
void | initialize () override |
it is called right before inference starts More... | |
void | finalize () override |
it is called right after inference ends More... | |
std::string | getInfo () override |
get the textual description of the component More... | |
float | getScore () const |
~BLEUScoreWriter () override=default | |
Static Protected Member Functions | |
static std::string | generateText (int sequenceLength, const int *currentOutputData, Vocabulary::ptr vocabulary) |
Private Attributes | |
std::shared_ptr< std::istream > | mReferenceInput |
Vocabulary::ptr | mVocabulary |
size_t | mReferenceLength |
size_t | mTranslationLength |
int | mMaxOrder |
bool | mSmooth |
std::vector< size_t > | mMatchesByOrder |
std::vector< size_t > | mPossibleMatchesByOrder |
all it does is to evaluate BLEU score
|
inherited |
nmtSample::BLEUScoreWriter::BLEUScoreWriter | ( | std::shared_ptr< std::istream > | referenceTextInput, |
Vocabulary::ptr | vocabulary, | ||
int | maxOrder = 4 |
||
) |
|
overridedefault |
|
overridevirtual |
write the generated sequence
Implements nmtSample::DataWriter.
|
overridevirtual |
it is called right before inference starts
Implements nmtSample::DataWriter.
|
overridevirtual |
it is called right after inference ends
Implements nmtSample::DataWriter.
|
overridevirtual |
get the textual description of the component
Implements nmtSample::Component.
float nmtSample::BLEUScoreWriter::getScore | ( | ) | const |
|
staticprotectedinherited |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |