| /nv-g11n/inputmethod/sunpinyin/slm/python/ |
| test.py | 12 pr, result = slm.transfer (SlmState(0,0), 58614) 13 print "pr =", pr, "\tresult = %s" % result 15 pr, result = slm.transfer (result, 75956) 16 print "pr =", pr, "\tresult = %s" % result 18 pr, result = slm.transfer (result, 84582) 19 print "pr =", pr, "\tresult = %s" % result
|
| /nv-g11n/inputmethod/sunpinyin2/python/ |
| test.py | 12 pr, result = slm.transfer (SlmState(0,0), 58614) 13 print "pr =", pr, "\tresult = %s" % result 15 pr, result = slm.transfer (result, 75956) 16 print "pr =", pr, "\tresult = %s" % result 18 pr, result = slm.transfer (result, 84582) 19 print "pr =", pr, "\tresult = %s" % result
|
| /nv-g11n/inputmethod/sunpinyin/ime/src/ |
| ic_history.h | 67 * @return pr(*(ite_wid-1) | *its_wid, ..., *(ite_wid-2)) 70 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid); 75 * @return pr(*wid | *its_wid, ..., *(ite_wid-1)) 78 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid, unsigned int wid); 116 * @return pr(*(ite_wid-1) | *(ite_wid-2)) 118 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid); 123 * @return pr(*wid | *(ite_wid-1)) 125 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid, unsigned int wid); 150 double pr(TBigram& bg);
|
| ic_history.cpp | 61 double CICHistory::pr(unsigned int* its_wid, unsigned int* ite_wid) function in class:CICHistory 66 double CICHistory::pr(unsigned int* its_wid, unsigned int* ite_wid, unsigned int wid) function in class:CICHistory 172 double CBigramHistory::pr(unsigned int* its_wid, unsigned int* ite_wid) function in class:CBigramHistory 181 return pr(bigram); 184 double CBigramHistory::pr(unsigned int* its_wid, unsigned int* ite_wid, unsigned int wid) function in class:CBigramHistory 190 return pr(bigram); 252 double CBigramHistory::pr(TBigram& bigram) function in class:CBigramHistory 257 double pr = 0.0; local 258 pr += 0.68*double(bf)/double(uf0+0.5); 259 pr += 0.32*double(uf1)/double(m_memory.size() + (contxt_memory_size-m_memory.size())/10) [all...] |
| /nv-g11n/inputmethod/sunpinyin2/src/ime-core/ |
| ic_history.h | 67 * @return pr(*(ite_wid-1) | *its_wid, ..., *(ite_wid-2)) 70 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid); 75 * @return pr(*wid | *its_wid, ..., *(ite_wid-1)) 78 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid, unsigned int wid); 116 * @return pr(*(ite_wid-1) | *(ite_wid-2)) 118 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid); 123 * @return pr(*wid | *(ite_wid-1)) 125 virtual double pr(unsigned int* its_wid, unsigned int* ite_wid, unsigned int wid); 156 double pr(TBigram& bg);
|
| ic_history.cpp | 67 double CICHistory::pr(unsigned* its_wid, unsigned* ite_wid) function in class:CICHistory 72 double CICHistory::pr(unsigned* its_wid, unsigned* ite_wid, unsigned wid) function in class:CICHistory 178 double CBigramHistory::pr(unsigned* its_wid, unsigned* ite_wid) function in class:CBigramHistory 187 return pr(bigram); 190 double CBigramHistory::pr(unsigned* its_wid, unsigned* ite_wid, unsigned wid) function in class:CBigramHistory 196 return pr(bigram); 297 double CBigramHistory::pr(TBigram& bigram) function in class:CBigramHistory 302 double pr = 0.0; local 303 pr += 0.68*double(bf)/double(uf0+0.5); 304 pr += 0.32*double(uf1)/double(m_memory.size() + (contxt_memory_size-m_memory.size())/10) [all...] |
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/slmprune/ |
| slmprune.cpp | 143 //cut item whoese pr == 1.0; and not psuedo tail 144 if (chchk->pr != ((bUseLogPr)?0.0:1.0) || (chchk+1) == chlast) { 204 // because pr in model can not be 1.0, so we use this to mark a item to be prune 208 (((TLeaf*)level[lvl]) + pinfo->idx)->pr = 0.0; // -log(1.0) 210 (((TLeaf*)level[lvl]) + pinfo->idx)->pr = 1.0; 213 (((TNode*)level[lvl]) + pinfo->idx)->pr = 0.0; // -log(1.0) 215 (((TNode*)level[lvl]) + pinfo->idx)->pr = 1.0; // -log(1.0) 238 sumnext += exp(-double(chh->pr)); 240 sumnext += double(chh->pr); 290 double PA, PB, PHW, PH_W, PH, BOW, _BOW, pr, p_r local [all...] |
| /nv-g11n/inputmethod/sunpinyin2/src/slm/slmprune/ |
| slmprune.cpp | 143 //cut item whoese pr == 1.0; and not psuedo tail 144 if (chchk->pr != ((bUseLogPr)?0.0:1.0) || (chchk+1) == chlast) { 204 // because pr in model can not be 1.0, so we use this to mark a item to be prune 208 (((TLeaf*)level[lvl]) + pinfo->idx)->pr = 0.0; // -log(1.0) 210 (((TLeaf*)level[lvl]) + pinfo->idx)->pr = 1.0; 213 (((TNode*)level[lvl]) + pinfo->idx)->pr = 0.0; // -log(1.0) 215 (((TNode*)level[lvl]) + pinfo->idx)->pr = 1.0; // -log(1.0) 238 sumnext += exp(-double(chh->pr)); 240 sumnext += double(chh->pr); 290 double PA, PB, PHW, PH_W, PH, BOW, _BOW, pr, p_r local [all...] |
| /nv-g11n/inputmethod/sunpinyin/ime/src/slm/ |
| slm.h | 48 * -# Compact all float value of -log(pr) into 65536 (16 bits) 50 * -# Compact all float value of -log(pr) into 16384 (14 bits) 125 unsigned int pr() const function in struct:CThreadSlm::TNode 155 void set_pr(unsigned int pr) 157 m_pr = pr; 239 inline unsigned int pr() const { return ((m_pr_hi << 14) + m_pr_lo); } function in struct:CThreadSlm::TLeaf 244 inline void set_pr(unsigned int pr) { m_pr_hi = ((pr >> 14) & 0x3); m_pr_lo = pr & 0x3FFF; }
|
| slm.cpp | 198 double pr = m_prTable[pBase[idx].pr()]; local 199 return (m_UseLogPr)?(cost+pr):(cost*pr); 208 double pr = m_prTable[pBase[idx].pr()]; local 209 return (m_UseLogPr)?(cost+pr):(cost*pr); 226 return cost + m_prTable[((TNode *)m_Levels[0])->pr()]; 228 return cost * m_prTable[((TNode *)m_Levels[0])->pr()]; [all...] |
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/ |
| slm.h | 48 * -# Compact all float value of -log(pr) into 65536 (16 bits) 50 * -# Compact all float value of -log(pr) into 16384 (14 bits) 125 unsigned int pr() const function in struct:CThreadSlm::TNode 155 void set_pr(unsigned int pr) 157 m_pr = pr; 239 inline unsigned int pr() const { return ((m_pr_hi << 14) + m_pr_lo); } function in struct:CThreadSlm::TLeaf 244 inline void set_pr(unsigned int pr) { m_pr_hi = ((pr >> 14) & 0x3); m_pr_lo = pr & 0x3FFF; }
|
| slm.cpp | 200 double pr = m_prTable[pBase[idx].pr()]; local 201 return (m_UseLogPr)?(cost+pr):(cost*pr); 210 double pr = m_prTable[pBase[idx].pr()]; local 211 return (m_UseLogPr)?(cost+pr):(cost*pr); 228 return cost + m_prTable[((TNode *)m_Levels[0])->pr()]; 230 return cost * m_prTable[((TNode *)m_Levels[0])->pr()]; [all...] |
| sim_slmbuilder.cpp | 347 double pr = disc->discount(ch[h].freq) / root_freq; local 348 assert(pr > 0.0 && pr < 1.0); 350 ch[h].pr = CSlmBuilder::PR_TYPE( -log(pr) ); 352 ch[h].pr = CSlmBuilder::PR_TYPE( pr ); 381 v0[0].pr = PR_TYPE(-log(double(1.0)/m_nWord)); 383 v0[0].pr = PR_TYPE(double(1.0)/m_nWord); 395 sumnext += exp(-(chh->pr)); [all...] |
| /nv-g11n/inputmethod/sunpinyin2/src/slm/ |
| slm.h | 48 * -# Compact all float value of -log(pr) into 65536 (16 bits) 50 * -# Compact all float value of -log(pr) into 16384 (14 bits) 125 unsigned int pr() const function in struct:CThreadSlm::TNode 155 void set_pr(unsigned int pr) 157 m_pr = pr; 239 inline unsigned int pr() const { return ((m_pr_hi << 14) + m_pr_lo); } function in struct:CThreadSlm::TLeaf 244 inline void set_pr(unsigned int pr) { m_pr_hi = ((pr >> 14) & 0x3); m_pr_lo = pr & 0x3FFF; }
|
| slm.cpp | 206 double pr = m_prTable[pBase[idx].pr()]; local 207 return (m_UseLogPr)?(cost+pr):(cost*pr); 216 double pr = m_prTable[pBase[idx].pr()]; local 217 return (m_UseLogPr)?(cost+pr):(cost*pr); 234 return cost + m_prTable[((TNode *)m_Levels[0])->pr()]; 236 return cost * m_prTable[((TNode *)m_Levels[0])->pr()]; [all...] |
| sim_slmbuilder.cpp | 347 double pr = disc->discount(ch[h].freq) / root_freq; local 348 assert(pr > 0.0 && pr < 1.0); 350 ch[h].pr = CSlmBuilder::PR_TYPE( -log(pr) ); 352 ch[h].pr = CSlmBuilder::PR_TYPE( pr ); 381 v0[0].pr = PR_TYPE(-log(double(1.0)/m_nWord)); 383 v0[0].pr = PR_TYPE(double(1.0)/m_nWord); 395 sumnext += exp(-(chh->pr)); [all...] |
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/tslmpack/ |
| arpa_slm.h | 52 float pr; member in struct:CArpaSlm::TLeaf 58 TLeaf() : wid(0), pr(.0), ch(0), bon(0), bol(0) {}
|
| arpa_conv.cpp | 63 unsigned pr_idx = get_pr_index(leaf.pr); 73 unsigned get_pr_index(float pr) { 74 std::map<float, int>::iterator prit = m_pr_map.find(pr); 76 double val = EffectivePr(pr); 115 unsigned pr_idx = m_leaf_conv.get_pr_index(node.pr);
|
| /nv-g11n/inputmethod/sunpinyin2/src/slm/tslmpack/ |
| arpa_slm.h | 52 float pr; member in struct:CArpaSlm::TLeaf 58 TLeaf() : wid(0), pr(.0), ch(0), bon(0), bol(0) {}
|
| arpa_conv.cpp | 63 unsigned pr_idx = get_pr_index(leaf.pr); 73 unsigned get_pr_index(float pr) { 74 std::map<float, int>::iterator prit = m_pr_map.find(pr); 76 double val = EffectivePr(pr); 115 unsigned pr_idx = m_leaf_conv.get_pr_index(node.pr);
|
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/tslminfo/ |
| tslminfo.cpp | 155 printf(" -p # Prefer normal probability instead of -log(Pr) which is default. Valid under -v option.\n"); 168 {"pr", 0, 0, 'p'}, 250 double pr = itslm.mapPr(pn->pr(), use_log_pr); local 252 printf("%16.12lf %16.12lf ", pr, bow); 263 double pr = itslm.mapPr(pn->pr(), use_log_pr); local 264 printf("%16.12lf ", pr); 289 printf((itslm.isUseLogPr())?" using -log(pr)\n":" using direct pr\n") [all...] |
| /nv-g11n/inputmethod/sunpinyin2/src/slm/tslminfo/ |
| tslminfo.cpp | 155 printf(" -p # Prefer normal probability instead of -log(Pr) which is default. Valid under -v option.\n"); 168 {"pr", 0, 0, 'p'}, 250 double pr = itslm.mapPr(pn->pr(), use_log_pr); local 252 printf("%16.12lf %16.12lf ", pr, bow); 263 double pr = itslm.mapPr(pn->pr(), use_log_pr); local 264 printf("%16.12lf ", pr); 289 printf((itslm.isUseLogPr())?" using -log(pr)\n":" using direct pr\n") [all...] |
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/slminfo/ |
| slminfo.cpp | 68 printf(" -p # Prefer normal probability than -log(Pr) which is default. Valid under -v option.\n"); 81 {"pr", 0, 0, 'p'}, 170 printf("%20.17lf ", double(nodes[lvl][0].pr)); 172 printf("%20.17lf ", exp(-double(nodes[lvl][0].pr))); 181 printf("%20.17lf ", -log(double(nodes[lvl][0].pr))); 183 printf("%20.17lf ", double(nodes[lvl][0].pr)); 250 printf("%s\n", (bLogPrFile)?("using -log(pr)"):("using direct pr"));
|
| /nv-g11n/inputmethod/sunpinyin2/src/slm/slminfo/ |
| slminfo.cpp | 68 printf(" -p # Prefer normal probability than -log(Pr) which is default. Valid under -v option.\n"); 81 {"pr", 0, 0, 'p'}, 170 printf("%20.17lf ", double(nodes[lvl][0].pr)); 172 printf("%20.17lf ", exp(-double(nodes[lvl][0].pr))); 181 printf("%20.17lf ", -log(double(nodes[lvl][0].pr))); 183 printf("%20.17lf ", double(nodes[lvl][0].pr)); 250 printf("%s\n", (bLogPrFile)?("using -log(pr)"):("using direct pr"));
|
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/slmseg/ |
| slmseg.cpp | 200 TLatticeStateValue(double pr=0.0, TLatticeWord* btword=NULL, CThreadSlm::TState btstate = CThreadSlm::TState()) 201 : m_pr(pr), mp_btword(btword), m_btstate(btstate) { } 254 * pr = 0 and its mp_btword == NULL; 301 double pr = itss->second.m_pr; local 302 pr += s_tslm->transferNegLog(his, itws->m_wordId, his); 307 rss[his] = TLatticeStateValue(pr, &(*itws), itss->first); 309 if (itn->second.m_pr > pr) { 310 rss[his] = TLatticeStateValue(pr, &(*itws), itss->first);
|