Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed decoder

  • Loading branch information...
commit fbca7cdaf19fb3ed16c081e145cd3a5b575aaabf 1 parent 06edb56
Andrew Danks authored
Showing with 3 additions and 10 deletions.
  1. +3 −10 A2_SMT/code/decode2.m
View
13 A2_SMT/code/decode2.m
@@ -71,10 +71,6 @@
AM.(CSC401_A2_DEFNS.SENTSTART ) = SS;
AM.(CSC401_A2_DEFNS.SENTEND ) = SE;
-if delta == -1
- [N, N_r, count_bigrams, S] = good_turing_init(LM)
-end
-
MX = 0;
for iew=1:length(VE)
if isfield(LM.uni, VE{iew}),
@@ -108,9 +104,7 @@
% initial best guess
bestHyp = cell2string(englishWords(1,order));
-
-p_bestHyp = lm_prob( processedLine, LM, lmtype, delta, vocabSize) + ...
-
+p_bestHyp = lm_prob( bestHyp, LM, lmtype, delta, vocabSize ) + ...
sum(log2(scores(1,order)));
@@ -136,8 +130,7 @@
% evaluate
newHyp = cell2string(diag(englishWords(wordInd,order)));
p_newHyp = lm_prob( newHyp, LM, lmtype, delta, vocabSize )+ ...
-
- sum(log2(diag(scores(wordInd,order))));
+ sum(log2(diag(scores(wordInd,order))));
if p_newHyp > p_bestHyp
p_bestHyp = p_newHyp;
@@ -148,7 +141,7 @@
end
-return
+end
function eSen = cell2string( c )
Please sign in to comment.
Something went wrong with that request. Please try again.