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 {
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.
47  // map from target grammar ids to kenlm ids.
50  float lmscale;
51  float lmwp;
52 };
53 
54 }
55 } // end namespaces
56 
57 #endif
float lmscale
Scales applied to each model.
Definition: data.lm.hpp:50
ucam::util::WordMapper * wm
Definition: data.lm.hpp:46
maps between grammar targets ids and lm ids
Language Model data structure.
Definition: data.lm.hpp:35
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
lm::base::Model * model
KenLM.
Definition: data.lm.hpp:41
class WordMapper
Definition: bleu.hpp:14