-
Notifications
You must be signed in to change notification settings - Fork 0
/
RescoreModule.h
44 lines (34 loc) · 1004 Bytes
/
RescoreModule.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* RescoreModule.h
*
* Created on: Feb 21, 2017
* Author: louis
*/
#ifndef RESCOREMODULE_H_
#define RESCOREMODULE_H_
#include "BackoffStrategy.h"
#include "NBestList.h"
#include <pattern.h>
namespace SLM {
class RescoreModule {
public:
RescoreModule(SLM::BackoffStrategy* bo, const std::string& outputDirectory);
virtual ~RescoreModule();
void nextFile(const std::string& originalFileName);
void rescoreFile();
void addLine(const std::string& sentenceString, int originalRank, double acousticModelScore, double languageModelScore, int numberOfWords);
void rescoreLine();
void evaluatePattern(const Pattern& focus, const Pattern& context, bool isOOV);
protected:
SLM::BackoffStrategy* backoffStrategy;
SLM::NBestList nbestList;
SLM::NBestItem* currentLine = nullptr;
double lprob = 0.0;
int oovs = 0;
int usedPatterns = 0;
int usedPatternsForLine = 0;
std::string originalFileName;
std::string outputDirectory;
};
} /* namespace SLM */
#endif /* RESCOREMODULE_H_ */