HowManyAreAnalyzed(): use status_user_agent to report progress
[linguistica.git] / cMTModel2Norm.h
blobf9538a50874e5c66d4568243f1c36ead0120dfc4
1 // Machine Translation model 2
2 // Copyright © 2009 The University of Chicago
3 #ifndef CMTMODEL2NORM_H
4 #define CMTMODEL2NORM_H
6 #include <QMap>
8 class mTVolca;
9 typedef QMap<int, double> IntToDouble;
10 typedef QMap<int, IntToDouble*> IntToIntToDouble;
12 class cMTModel2Norm {
13 public:
14 class cMT* m_myMT;
15 int m_Iterations;
16 /// set as 10 now...
17 int m_sentenceNormChunk;
18 bool m_getTfromModel1;
20 // alignment parameters.
22 QMap<int, QMap<int, double>*> m_T;
23 /// Here, we use different idea,
24 /// we normalize the len of a sentence to m_sentenceNormChunk.
25 /// Also, the A is [language2][language1],
26 /// this is different from T !! Discuss to do ?
27 QMap<int, QMap<int, double>*> m_A;
28 QMap<int, QMap<int, double>*> m_softCountOfT;
29 QMap<int, QMap<int, double>*> m_softCountOfA;
30 QMap<int, double> m_lamdaT;
31 QMap<int, double> m_lamdaA;
32 public:
33 // construction/destruction.
35 cMTModel2Norm(cMT* driver, int iterations, bool from_model1);
36 virtual ~cMTModel2Norm();
38 // disable default-construction, copy
39 private:
40 cMTModel2Norm();
41 cMTModel2Norm(const cMTModel2Norm& x);
42 cMTModel2Norm& operator=(const cMTModel2Norm& x);
43 public:
44 void initTandA();
45 void addSoftCountOfTandA(int);
46 void EMLoops(int);
47 void clearSoftCounts();
48 void EStep();
49 void MStep();
50 void releaseSoftCounts();
51 void viterbi(int);
52 void viterbiAll();
55 #endif // CMTMODEL2NORM_H