Cambridge SMT System
data.lm.hpp
Go to the documentation of this file.
1
// Licensed under the Apache License, Version 2.0 (the "License");
2
// you may not use these files except in compliance with the License.
3
// You may obtain a copy of the License at
4
//
5
// http://www.apache.org/licenses/LICENSE-2.0
6
//
7
// Unless required by applicable law or agreed to in writing, software
8
// distributed under the License is distributed on an "AS IS" BASIS,
9
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
// See the License for the specific language governing permissions and
11
// limitations under the License.
12
13
// Copyright 2012 - Gonzalo Iglesias, AdriĆ de Gispert, William Byrne
14
15
#ifndef DATA_LM_HPP
16
#define DATA_LM_HPP
17
25
#include <
wordmapper.hpp
>
26
#include <
idbridge.hpp
>
27
28
namespace
ucam
{
29
namespace
fsttools {
30
35
struct
KenLMData
{
36
KenLMData
() :
37
model
( NULL ),
38
lmscale
( 1.0f ),
39
lmwp
(0.0f),
40
wm
(NULL) {
41
};
42
44
lm::base::Model *
model
;
45
// Pointer to target grammar wordmap, if provided.
46
ucam::util::WordMapper
*
wm
;
47
// map from target grammar ids to kenlm ids.
48
IdBridge
idb
;
50
float
lmscale
;
51
float
lmwp
;
52
};
53
54
}
55
}
// end namespaces
56
57
#endif
ucam::fsttools::KenLMData::KenLMData
KenLMData()
Definition:
data.lm.hpp:36
ucam::fsttools::IdBridge
Definition:
idbridge.hpp:31
ucam::fsttools::KenLMData::lmscale
float lmscale
Scales applied to each model.
Definition:
data.lm.hpp:50
ucam::fsttools::KenLMData::wm
ucam::util::WordMapper * wm
Definition:
data.lm.hpp:46
ucam::fsttools::KenLMData::lmwp
float lmwp
Definition:
data.lm.hpp:51
idbridge.hpp
maps between grammar targets ids and lm ids
ucam::fsttools::KenLMData
Language Model data structure.
Definition:
data.lm.hpp:35
ucam::util::WordMapper
Loads efficiently a wordmap file and provides methods to map word-to-integer or integer-to-word. To avoid memory footprint issues, hashing the wordmap entries is avoided.
Definition:
wordmapper.hpp:63
ucam::fsttools::KenLMData::model
lm::base::Model * model
KenLM.
Definition:
data.lm.hpp:41
wordmapper.hpp
class WordMapper
ucam::fsttools::KenLMData::idb
IdBridge idb
Definition:
data.lm.hpp:48
ucam
Definition:
bleu.hpp:14
ucam-smt
cpp
fsttools
include
data.lm.hpp
Generated on Wed May 25 2016 10:26:00 for Cambridge SMT System by
1.8.11